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 | awscc.dynamodb.global_tables |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
multi_region_consistency | string | |
table_id | string | |
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. |
warm_throughput | object | Provides visibility into the number of read and write operations your table or secondary index can instantaneously support. The settings can be modified using the ``UpdateTable`` operation to meet the throughput requirements of an upcoming peak event. |
replicas | array | |
write_provisioned_throughput_settings | object | |
write_on_demand_throughput_settings | object | |
global_table_witnesses | array | |
table_name | string | |
attribute_definitions | array | |
billing_mode | string | |
global_secondary_indexes | array | |
key_schema | array | |
local_secondary_indexes | array | |
arn | string | |
stream_arn | 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. |
| Name | Datatype | Description |
|---|---|---|
table_name | string | |
region | string | AWS region. |
For more information, see AWS::DynamoDB::GlobalTable.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | global_tables | INSERT | KeySchema, AttributeDefinitions, Replicas, region |
delete_resource | global_tables | DELETE | Identifier, region |
update_resource | global_tables | UPDATE | Identifier, PatchDocument, region |
list_resources | global_tables_list_only | SELECT | region |
get_resource | global_tables | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual global_table.
SELECT
region,
multi_region_consistency,
table_id,
sse_specification,
stream_specification,
warm_throughput,
replicas,
write_provisioned_throughput_settings,
write_on_demand_throughput_settings,
global_table_witnesses,
table_name,
attribute_definitions,
billing_mode,
global_secondary_indexes,
key_schema,
local_secondary_indexes,
arn,
stream_arn,
time_to_live_specification
FROM awscc.dynamodb.global_tables
WHERE
region = 'us-east-1' AND
Identifier = '{{ table_name }}';
Lists all global_tables in a region.
SELECT
region,
table_name
FROM awscc.dynamodb.global_tables_list_only
WHERE
region = 'us-east-1';
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 awscc.dynamodb.global_tables (
Replicas,
AttributeDefinitions,
KeySchema,
region
)
SELECT
'{{ replicas }}',
'{{ attribute_definitions }}',
'{{ key_schema }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.dynamodb.global_tables (
MultiRegionConsistency,
SSESpecification,
StreamSpecification,
WarmThroughput,
Replicas,
WriteProvisionedThroughputSettings,
WriteOnDemandThroughputSettings,
GlobalTableWitnesses,
TableName,
AttributeDefinitions,
BillingMode,
GlobalSecondaryIndexes,
KeySchema,
LocalSecondaryIndexes,
TimeToLiveSpecification,
region
)
SELECT
'{{ multi_region_consistency }}',
'{{ sse_specification }}',
'{{ stream_specification }}',
'{{ warm_throughput }}',
'{{ replicas }}',
'{{ write_provisioned_throughput_settings }}',
'{{ write_on_demand_throughput_settings }}',
'{{ global_table_witnesses }}',
'{{ table_name }}',
'{{ attribute_definitions }}',
'{{ billing_mode }}',
'{{ global_secondary_indexes }}',
'{{ key_schema }}',
'{{ local_secondary_indexes }}',
'{{ time_to_live_specification }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: global_table
props:
- name: multi_region_consistency
value: '{{ multi_region_consistency }}'
- name: sse_specification
value:
sse_enabled: '{{ sse_enabled }}'
sse_type: '{{ sse_type }}'
kms_master_key_id: '{{ kms_master_key_id }}'
- name: stream_specification
value:
stream_view_type: '{{ stream_view_type }}'
resource_policy:
policy_document: {}
- name: warm_throughput
value:
read_units_per_second: '{{ read_units_per_second }}'
write_units_per_second: '{{ write_units_per_second }}'
- name: replicas
value:
- sse_specification:
kms_master_key_id: '{{ kms_master_key_id }}'
kinesis_stream_specification:
approximate_creation_date_time_precision: '{{ approximate_creation_date_time_precision }}'
stream_arn: '{{ stream_arn }}'
contributor_insights_specification:
mode: '{{ mode }}'
enabled: '{{ enabled }}'
point_in_time_recovery_specification:
point_in_time_recovery_enabled: '{{ point_in_time_recovery_enabled }}'
recovery_period_in_days: '{{ recovery_period_in_days }}'
replica_stream_specification:
resource_policy: null
global_secondary_indexes:
- index_name: '{{ index_name }}'
contributor_insights_specification: null
read_provisioned_throughput_settings:
read_capacity_units: '{{ read_capacity_units }}'
read_capacity_auto_scaling_settings:
min_capacity: '{{ min_capacity }}'
seed_capacity: '{{ seed_capacity }}'
target_tracking_scaling_policy_configuration:
scale_out_cooldown: '{{ scale_out_cooldown }}'
target_value: null
disable_scale_in: '{{ disable_scale_in }}'
scale_in_cooldown: '{{ scale_in_cooldown }}'
max_capacity: '{{ max_capacity }}'
read_on_demand_throughput_settings:
max_read_request_units: '{{ max_read_request_units }}'
region: '{{ region }}'
resource_policy: null
read_provisioned_throughput_settings: null
table_class: '{{ table_class }}'
deletion_protection_enabled: '{{ deletion_protection_enabled }}'
tags:
- value: '{{ value }}'
key: '{{ key }}'
read_on_demand_throughput_settings: null
- name: write_provisioned_throughput_settings
value:
write_capacity_auto_scaling_settings: null
- name: write_on_demand_throughput_settings
value:
max_write_request_units: '{{ max_write_request_units }}'
- name: global_table_witnesses
value:
- region: '{{ region }}'
- name: table_name
value: '{{ table_name }}'
- name: attribute_definitions
value:
- attribute_type: '{{ attribute_type }}'
attribute_name: '{{ attribute_name }}'
- name: billing_mode
value: '{{ billing_mode }}'
- name: global_secondary_indexes
value:
- index_name: '{{ index_name }}'
on_demand_throughput:
max_read_request_units: '{{ max_read_request_units }}'
max_write_request_units: '{{ max_write_request_units }}'
contributor_insights_specification: null
projection:
non_key_attributes:
- '{{ non_key_attributes[0] }}'
projection_type: '{{ projection_type }}'
provisioned_throughput:
write_capacity_units: '{{ write_capacity_units }}'
read_capacity_units: '{{ read_capacity_units }}'
key_schema:
- key_type: '{{ key_type }}'
attribute_name: '{{ attribute_name }}'
warm_throughput: null
- name: key_schema
value:
- null
- name: local_secondary_indexes
value:
- index_name: '{{ index_name }}'
projection: null
key_schema:
- null
- name: time_to_live_specification
value:
enabled: '{{ enabled }}'
attribute_name: '{{ attribute_name }}'
UPDATE example
Use the following StackQL query and manifest file to update a global_table resource, using stack-deploy.
/*+ update */
UPDATE awscc.dynamodb.global_tables
SET PatchDocument = string('{{ {
"MultiRegionConsistency": multi_region_consistency,
"SSESpecification": sse_specification,
"StreamSpecification": stream_specification,
"WarmThroughput": warm_throughput,
"Replicas": replicas,
"WriteProvisionedThroughputSettings": write_provisioned_throughput_settings,
"WriteOnDemandThroughputSettings": write_on_demand_throughput_settings,
"GlobalTableWitnesses": global_table_witnesses,
"AttributeDefinitions": attribute_definitions,
"BillingMode": billing_mode,
"GlobalSecondaryIndexes": global_secondary_indexes,
"TimeToLiveSpecification": time_to_live_specification
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ table_name }}';
DELETE example
/*+ delete */
DELETE FROM awscc.dynamodb.global_tables
WHERE
Identifier = '{{ table_name }}' AND
region = 'us-east-1';
Permissions
To operate on the global_tables resource, the following permissions are required:
- Read
- Create
- Update
- List
- Delete
dynamodb:Describe*,
dynamodb:GetResourcePolicy,
application-autoscaling:Describe*,
cloudwatch:PutMetricData,
dynamodb:ListTagsOfResource,
kms:DescribeKey
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
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
dynamodb:ListTables,
cloudwatch:PutMetricData
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