global_tables
Creates, updates, deletes or gets a global_table
resource or lists global_tables
in a region
Overview
Name | global_tables |
Type | Resource |
Description | Version: None. Resource Type definition for AWS::DynamoDB::GlobalTable |
Id | aws.dynamodb.global_tables |
Fields
Name | Datatype | Description |
---|---|---|
arn | string | |
stream_arn | string | |
attribute_definitions | array | |
billing_mode | string | |
global_secondary_indexes | array | |
key_schema | array | |
local_secondary_indexes | array | |
write_provisioned_throughput_settings | object | |
write_on_demand_throughput_settings | object | |
replicas | array | |
sse_specification | object | Represents the settings used to enable server-side encryption. |
stream_specification | object | Represents the DynamoDB Streams configuration for a table in DynamoDB. |
table_name | string | |
table_id | string | |
time_to_live_specification | object | Represents the settings used to enable or disable Time to Live (TTL) for the specified table. |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | KeySchema, AttributeDefinitions, Replicas, region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__Identifier, region |
SELECT
examples
Gets all global_tables
in a region.
SELECT
region,
arn,
stream_arn,
attribute_definitions,
billing_mode,
global_secondary_indexes,
key_schema,
local_secondary_indexes,
write_provisioned_throughput_settings,
write_on_demand_throughput_settings,
replicas,
sse_specification,
stream_specification,
table_name,
table_id,
time_to_live_specification
FROM aws.dynamodb.global_tables
WHERE region = 'us-east-1';
Gets all properties from an individual global_table
.
SELECT
region,
arn,
stream_arn,
attribute_definitions,
billing_mode,
global_secondary_indexes,
key_schema,
local_secondary_indexes,
write_provisioned_throughput_settings,
write_on_demand_throughput_settings,
replicas,
sse_specification,
stream_specification,
table_name,
table_id,
time_to_live_specification
FROM aws.dynamodb.global_tables
WHERE region = 'us-east-1' AND data__Identifier = '<TableName>';
INSERT
example
Use the following StackQL query and manifest file to create a new global_table
resource, using stack-deploy
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.dynamodb.global_tables (
AttributeDefinitions,
KeySchema,
Replicas,
region
)
SELECT
'{{ AttributeDefinitions }}',
'{{ KeySchema }}',
'{{ Replicas }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.dynamodb.global_tables (
AttributeDefinitions,
BillingMode,
GlobalSecondaryIndexes,
KeySchema,
LocalSecondaryIndexes,
WriteProvisionedThroughputSettings,
WriteOnDemandThroughputSettings,
Replicas,
SSESpecification,
StreamSpecification,
TableName,
TimeToLiveSpecification,
region
)
SELECT
'{{ AttributeDefinitions }}',
'{{ BillingMode }}',
'{{ GlobalSecondaryIndexes }}',
'{{ KeySchema }}',
'{{ LocalSecondaryIndexes }}',
'{{ WriteProvisionedThroughputSettings }}',
'{{ WriteOnDemandThroughputSettings }}',
'{{ Replicas }}',
'{{ SSESpecification }}',
'{{ StreamSpecification }}',
'{{ TableName }}',
'{{ TimeToLiveSpecification }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: global_table
props:
- name: AttributeDefinitions
value:
- AttributeType: '{{ AttributeType }}'
AttributeName: '{{ AttributeName }}'
- name: BillingMode
value: '{{ BillingMode }}'
- name: GlobalSecondaryIndexes
value:
- IndexName: '{{ IndexName }}'
OnDemandThroughput:
MaxReadRequestUnits: '{{ MaxReadRequestUnits }}'
MaxWriteRequestUnits: '{{ MaxWriteRequestUnits }}'
ContributorInsightsSpecification:
Enabled: '{{ Enabled }}'
Projection:
NonKeyAttributes:
- '{{ NonKeyAttributes[0] }}'
ProjectionType: '{{ ProjectionType }}'
ProvisionedThroughput:
WriteCapacityUnits: '{{ WriteCapacityUnits }}'
ReadCapacityUnits: '{{ ReadCapacityUnits }}'
KeySchema:
- KeyType: '{{ KeyType }}'
AttributeName: '{{ AttributeName }}'
- name: KeySchema
value:
- null
- name: LocalSecondaryIndexes
value:
- IndexName: '{{ IndexName }}'
Projection: null
KeySchema:
- null
- name: WriteProvisionedThroughputSettings
value:
WriteCapacityAutoScalingSettings:
MinCapacity: '{{ MinCapacity }}'
MaxCapacity: '{{ MaxCapacity }}'
SeedCapacity: '{{ SeedCapacity }}'
TargetTrackingScalingPolicyConfiguration:
DisableScaleIn: '{{ DisableScaleIn }}'
ScaleInCooldown: '{{ ScaleInCooldown }}'
ScaleOutCooldown: '{{ ScaleOutCooldown }}'
TargetValue: null
- name: WriteOnDemandThroughputSettings
value:
MaxWriteRequestUnits: '{{ MaxWriteRequestUnits }}'
- name: Replicas
value:
- Region: '{{ Region }}'
GlobalSecondaryIndexes:
- IndexName: '{{ IndexName }}'
ContributorInsightsSpecification: null
ReadProvisionedThroughputSettings:
ReadCapacityUnits: '{{ ReadCapacityUnits }}'
ReadCapacityAutoScalingSettings: null
ReadOnDemandThroughputSettings:
MaxReadRequestUnits: '{{ MaxReadRequestUnits }}'
ContributorInsightsSpecification: null
PointInTimeRecoverySpecification:
PointInTimeRecoveryEnabled: '{{ PointInTimeRecoveryEnabled }}'
TableClass: '{{ TableClass }}'
DeletionProtectionEnabled: '{{ DeletionProtectionEnabled }}'
SSESpecification:
KMSMasterKeyId: '{{ KMSMasterKeyId }}'
Tags:
- Value: '{{ Value }}'
Key: '{{ Key }}'
ReadProvisionedThroughputSettings: null
ReadOnDemandThroughputSettings: null
KinesisStreamSpecification:
ApproximateCreationDateTimePrecision: '{{ ApproximateCreationDateTimePrecision }}'
StreamArn: '{{ StreamArn }}'
ResourcePolicy:
PolicyDocument: {}
ReplicaStreamSpecification:
ResourcePolicy: null
- name: SSESpecification
value:
SSEEnabled: '{{ SSEEnabled }}'
SSEType: '{{ SSEType }}'
KMSMasterKeyId: '{{ KMSMasterKeyId }}'
- name: StreamSpecification
value:
StreamViewType: '{{ StreamViewType }}'
ResourcePolicy: null
- name: TableName
value: '{{ TableName }}'
- name: TimeToLiveSpecification
value:
Enabled: '{{ Enabled }}'
AttributeName: '{{ AttributeName }}'
DELETE
example
/*+ delete */
DELETE FROM aws.dynamodb.global_tables
WHERE data__Identifier = '<TableName>'
AND region = 'us-east-1';
Permissions
To operate on the global_tables
resource, the following permissions are required:
Create
dynamodb:CreateTable,
dynamodb:CreateTableReplica,
dynamodb:Describe*,
dynamodb:UpdateTimeToLive,
dynamodb:UpdateContributorInsights,
dynamodb:UpdateContinuousBackups,
dynamodb:ListTagsOfResource,
dynamodb:Query,
dynamodb:Scan,
dynamodb:UpdateItem,
dynamodb:PutItem,
dynamodb:GetItem,
dynamodb:DeleteItem,
dynamodb:BatchWriteItem,
dynamodb:TagResource,
dynamodb:EnableKinesisStreamingDestination,
dynamodb:DisableKinesisStreamingDestination,
dynamodb:UpdateTableReplicaAutoScaling,
dynamodb:TagResource,
dynamodb:GetResourcePolicy,
dynamodb:PutResourcePolicy,
application-autoscaling:DeleteScalingPolicy,
application-autoscaling:DeleteScheduledAction,
application-autoscaling:DeregisterScalableTarget,
application-autoscaling:Describe*,
application-autoscaling:PutScalingPolicy,
application-autoscaling:PutScheduledAction,
application-autoscaling:RegisterScalableTarget,
kinesis:ListStreams,
kinesis:DescribeStream,
kinesis:PutRecords,
kms:CreateGrant,
kms:DescribeKey,
kms:ListAliases,
kms:Decrypt,
kms:RevokeGrant,
cloudwatch:PutMetricData,
iam:CreateServiceLinkedRole
Read
dynamodb:Describe*,
dynamodb:GetResourcePolicy,
application-autoscaling:Describe*,
cloudwatch:PutMetricData,
dynamodb:ListTagsOfResource,
kms:DescribeKey
Update
dynamodb:Describe*,
dynamodb:CreateTableReplica,
dynamodb:UpdateTable,
dynamodb:UpdateTimeToLive,
dynamodb:UpdateContinuousBackups,
dynamodb:UpdateContributorInsights,
dynamodb:ListTagsOfResource,
dynamodb:Query,
dynamodb:Scan,
dynamodb:UpdateItem,
dynamodb:PutItem,
dynamodb:GetItem,
dynamodb:DeleteItem,
dynamodb:BatchWriteItem,
dynamodb:DeleteTable,
dynamodb:DeleteTableReplica,
dynamodb:UpdateItem,
dynamodb:TagResource,
dynamodb:UntagResource,
dynamodb:EnableKinesisStreamingDestination,
dynamodb:DisableKinesisStreamingDestination,
dynamodb:UpdateTableReplicaAutoScaling,
dynamodb:UpdateKinesisStreamingDestination,
dynamodb:GetResourcePolicy,
dynamodb:PutResourcePolicy,
dynamodb:DeleteResourcePolicy,
application-autoscaling:DeleteScalingPolicy,
application-autoscaling:DeleteScheduledAction,
application-autoscaling:DeregisterScalableTarget,
application-autoscaling:Describe*,
application-autoscaling:PutScalingPolicy,
application-autoscaling:PutScheduledAction,
application-autoscaling:RegisterScalableTarget,
kinesis:ListStreams,
kinesis:DescribeStream,
kinesis:PutRecords,
kms:CreateGrant,
kms:DescribeKey,
kms:ListAliases,
kms:RevokeGrant,
cloudwatch:PutMetricData
Delete
dynamodb:Describe*,
dynamodb:DeleteTable,
application-autoscaling:DeleteScalingPolicy,
application-autoscaling:DeleteScheduledAction,
application-autoscaling:DeregisterScalableTarget,
application-autoscaling:Describe*,
application-autoscaling:PutScalingPolicy,
application-autoscaling:PutScheduledAction,
application-autoscaling:RegisterScalableTarget
List
dynamodb:ListTables,
cloudwatch:PutMetricData