CfnGlobalTableProps
- class aws_cdk.aws_dynamodb.CfnGlobalTableProps(*, attribute_definitions, key_schema, replicas, billing_mode=None, global_secondary_indexes=None, local_secondary_indexes=None, sse_specification=None, stream_specification=None, table_name=None, time_to_live_specification=None, write_on_demand_throughput_settings=None, write_provisioned_throughput_settings=None)
Bases:
object
Properties for defining a
CfnGlobalTable
.- Parameters:
attribute_definitions (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,AttributeDefinitionProperty
,Dict
[str
,Any
]]]]) – A list of attributes that describe the key schema for the global table and indexes.key_schema (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,KeySchemaProperty
,Dict
[str
,Any
]]]]) – Specifies the attributes that make up the primary key for the table. The attributes in theKeySchema
property must also be defined in theAttributeDefinitions
property.replicas (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,ReplicaSpecificationProperty
,Dict
[str
,Any
]]]]) – Specifies the list of replicas for your global table. The list must contain at least one element, the region where the stack defining the global table is deployed. For example, if you define your table in a stack deployed to us-east-1, you must have an entry inReplicas
with the region us-east-1. You cannot remove the replica in the stack region. .. epigraph:: Adding a replica might take a few minutes for an empty table, or up to several hours for large tables. If you want to add or remove a replica, we recommend submitting anUpdateStack
operation containing only that change. If you add or delete a replica during an update, we recommend that you don’t update any other resources. If your stack fails to update and is rolled back while adding a new replica, you might need to manually delete the replica. You can create a new global table with as many replicas as needed. You can add or remove replicas after table creation, but you can only add or remove a single replica in each update.billing_mode (
Optional
[str
]) – Specifies how you are charged for read and write throughput and how you manage capacity. Valid values are:. -PAY_PER_REQUEST
-PROVISIONED
All replicas in your global table will have the same billing mode. If you usePROVISIONED
billing mode, you must provide an auto scaling configuration via theWriteProvisionedThroughputSettings
property. The default value of this property isPROVISIONED
.global_secondary_indexes (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,GlobalSecondaryIndexProperty
,Dict
[str
,Any
]]],None
]) – Global secondary indexes to be created on the global table. You can create up to 20 global secondary indexes. Each replica in your global table will have the same global secondary index settings. You can only create or delete one global secondary index in a single stack operation. Since the backfilling of an index could take a long time, CloudFormation does not wait for the index to become active. If a stack operation rolls back, CloudFormation might not delete an index that has been added. In that case, you will need to delete the index manually.local_secondary_indexes (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,LocalSecondaryIndexProperty
,Dict
[str
,Any
]]],None
]) – Local secondary indexes to be created on the table. You can create up to five local secondary indexes. Each index is scoped to a given hash key value. The size of each hash key can be up to 10 gigabytes. Each replica in your global table will have the same local secondary index settings.sse_specification (
Union
[IResolvable
,SSESpecificationProperty
,Dict
[str
,Any
],None
]) – Specifies the settings to enable server-side encryption. These settings will be applied to all replicas. If you plan to use customer-managed KMS keys, you must provide a key for each replica using theReplicaSpecification.ReplicaSSESpecification
property.stream_specification (
Union
[IResolvable
,StreamSpecificationProperty
,Dict
[str
,Any
],None
]) – Specifies the streams settings on your global table. You must provide a value for this property if your global table contains more than one replica. You can only change the streams settings if your global table has only one replica.table_name (
Optional
[str
]) – A name for the global table. If you don’t specify a name, AWS CloudFormation generates a unique ID and uses that ID as the table name. For more information, see Name type . .. epigraph:: If you specify a name, you cannot perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name.time_to_live_specification (
Union
[IResolvable
,TimeToLiveSpecificationProperty
,Dict
[str
,Any
],None
]) – Specifies the time to live (TTL) settings for the table. This setting will be applied to all replicas.write_on_demand_throughput_settings (
Union
[IResolvable
,WriteOnDemandThroughputSettingsProperty
,Dict
[str
,Any
],None
]) – Sets the write request settings for a global table or a global secondary index. You must specify this setting if you set theBillingMode
toPAY_PER_REQUEST
.write_provisioned_throughput_settings (
Union
[IResolvable
,WriteProvisionedThroughputSettingsProperty
,Dict
[str
,Any
],None
]) – Specifies an auto scaling policy for write capacity. This policy will be applied to all replicas. This setting must be specified ifBillingMode
is set toPROVISIONED
.
- See:
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-globaltable.html
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_dynamodb as dynamodb # policy_document: Any cfn_global_table_props = dynamodb.CfnGlobalTableProps( attribute_definitions=[dynamodb.CfnGlobalTable.AttributeDefinitionProperty( attribute_name="attributeName", attribute_type="attributeType" )], key_schema=[dynamodb.CfnGlobalTable.KeySchemaProperty( attribute_name="attributeName", key_type="keyType" )], replicas=[dynamodb.CfnGlobalTable.ReplicaSpecificationProperty( region="region", # the properties below are optional contributor_insights_specification=dynamodb.CfnGlobalTable.ContributorInsightsSpecificationProperty( enabled=False ), deletion_protection_enabled=False, global_secondary_indexes=[dynamodb.CfnGlobalTable.ReplicaGlobalSecondaryIndexSpecificationProperty( index_name="indexName", # the properties below are optional contributor_insights_specification=dynamodb.CfnGlobalTable.ContributorInsightsSpecificationProperty( enabled=False ), read_on_demand_throughput_settings=dynamodb.CfnGlobalTable.ReadOnDemandThroughputSettingsProperty( max_read_request_units=123 ), read_provisioned_throughput_settings=dynamodb.CfnGlobalTable.ReadProvisionedThroughputSettingsProperty( read_capacity_auto_scaling_settings=dynamodb.CfnGlobalTable.CapacityAutoScalingSettingsProperty( max_capacity=123, min_capacity=123, target_tracking_scaling_policy_configuration=dynamodb.CfnGlobalTable.TargetTrackingScalingPolicyConfigurationProperty( target_value=123, # the properties below are optional disable_scale_in=False, scale_in_cooldown=123, scale_out_cooldown=123 ), # the properties below are optional seed_capacity=123 ), read_capacity_units=123 ) )], kinesis_stream_specification=dynamodb.CfnGlobalTable.KinesisStreamSpecificationProperty( stream_arn="streamArn", # the properties below are optional approximate_creation_date_time_precision="approximateCreationDateTimePrecision" ), point_in_time_recovery_specification=dynamodb.CfnGlobalTable.PointInTimeRecoverySpecificationProperty( point_in_time_recovery_enabled=False ), read_on_demand_throughput_settings=dynamodb.CfnGlobalTable.ReadOnDemandThroughputSettingsProperty( max_read_request_units=123 ), read_provisioned_throughput_settings=dynamodb.CfnGlobalTable.ReadProvisionedThroughputSettingsProperty( read_capacity_auto_scaling_settings=dynamodb.CfnGlobalTable.CapacityAutoScalingSettingsProperty( max_capacity=123, min_capacity=123, target_tracking_scaling_policy_configuration=dynamodb.CfnGlobalTable.TargetTrackingScalingPolicyConfigurationProperty( target_value=123, # the properties below are optional disable_scale_in=False, scale_in_cooldown=123, scale_out_cooldown=123 ), # the properties below are optional seed_capacity=123 ), read_capacity_units=123 ), replica_stream_specification=dynamodb.CfnGlobalTable.ReplicaStreamSpecificationProperty( resource_policy=dynamodb.CfnGlobalTable.ResourcePolicyProperty( policy_document=policy_document ) ), resource_policy=dynamodb.CfnGlobalTable.ResourcePolicyProperty( policy_document=policy_document ), sse_specification=dynamodb.CfnGlobalTable.ReplicaSSESpecificationProperty( kms_master_key_id="kmsMasterKeyId" ), table_class="tableClass", tags=[CfnTag( key="key", value="value" )] )], # the properties below are optional billing_mode="billingMode", global_secondary_indexes=[dynamodb.CfnGlobalTable.GlobalSecondaryIndexProperty( index_name="indexName", key_schema=[dynamodb.CfnGlobalTable.KeySchemaProperty( attribute_name="attributeName", key_type="keyType" )], projection=dynamodb.CfnGlobalTable.ProjectionProperty( non_key_attributes=["nonKeyAttributes"], projection_type="projectionType" ), # the properties below are optional write_on_demand_throughput_settings=dynamodb.CfnGlobalTable.WriteOnDemandThroughputSettingsProperty( max_write_request_units=123 ), write_provisioned_throughput_settings=dynamodb.CfnGlobalTable.WriteProvisionedThroughputSettingsProperty( write_capacity_auto_scaling_settings=dynamodb.CfnGlobalTable.CapacityAutoScalingSettingsProperty( max_capacity=123, min_capacity=123, target_tracking_scaling_policy_configuration=dynamodb.CfnGlobalTable.TargetTrackingScalingPolicyConfigurationProperty( target_value=123, # the properties below are optional disable_scale_in=False, scale_in_cooldown=123, scale_out_cooldown=123 ), # the properties below are optional seed_capacity=123 ) ) )], local_secondary_indexes=[dynamodb.CfnGlobalTable.LocalSecondaryIndexProperty( index_name="indexName", key_schema=[dynamodb.CfnGlobalTable.KeySchemaProperty( attribute_name="attributeName", key_type="keyType" )], projection=dynamodb.CfnGlobalTable.ProjectionProperty( non_key_attributes=["nonKeyAttributes"], projection_type="projectionType" ) )], sse_specification=dynamodb.CfnGlobalTable.SSESpecificationProperty( sse_enabled=False, # the properties below are optional sse_type="sseType" ), stream_specification=dynamodb.CfnGlobalTable.StreamSpecificationProperty( stream_view_type="streamViewType" ), table_name="tableName", time_to_live_specification=dynamodb.CfnGlobalTable.TimeToLiveSpecificationProperty( enabled=False, # the properties below are optional attribute_name="attributeName" ), write_on_demand_throughput_settings=dynamodb.CfnGlobalTable.WriteOnDemandThroughputSettingsProperty( max_write_request_units=123 ), write_provisioned_throughput_settings=dynamodb.CfnGlobalTable.WriteProvisionedThroughputSettingsProperty( write_capacity_auto_scaling_settings=dynamodb.CfnGlobalTable.CapacityAutoScalingSettingsProperty( max_capacity=123, min_capacity=123, target_tracking_scaling_policy_configuration=dynamodb.CfnGlobalTable.TargetTrackingScalingPolicyConfigurationProperty( target_value=123, # the properties below are optional disable_scale_in=False, scale_in_cooldown=123, scale_out_cooldown=123 ), # the properties below are optional seed_capacity=123 ) ) )
Attributes
- attribute_definitions
A list of attributes that describe the key schema for the global table and indexes.
- billing_mode
.
PAY_PER_REQUEST
PROVISIONED
All replicas in your global table will have the same billing mode. If you use
PROVISIONED
billing mode, you must provide an auto scaling configuration via theWriteProvisionedThroughputSettings
property. The default value of this property isPROVISIONED
.- See:
- Type:
Specifies how you are charged for read and write throughput and how you manage capacity. Valid values are
- global_secondary_indexes
Global secondary indexes to be created on the global table.
You can create up to 20 global secondary indexes. Each replica in your global table will have the same global secondary index settings. You can only create or delete one global secondary index in a single stack operation.
Since the backfilling of an index could take a long time, CloudFormation does not wait for the index to become active. If a stack operation rolls back, CloudFormation might not delete an index that has been added. In that case, you will need to delete the index manually.
- key_schema
Specifies the attributes that make up the primary key for the table.
The attributes in the
KeySchema
property must also be defined in theAttributeDefinitions
property.
- local_secondary_indexes
Local secondary indexes to be created on the table.
You can create up to five local secondary indexes. Each index is scoped to a given hash key value. The size of each hash key can be up to 10 gigabytes. Each replica in your global table will have the same local secondary index settings.
- replicas
Specifies the list of replicas for your global table.
The list must contain at least one element, the region where the stack defining the global table is deployed. For example, if you define your table in a stack deployed to us-east-1, you must have an entry in
Replicas
with the region us-east-1. You cannot remove the replica in the stack region. .. epigraph:Adding a replica might take a few minutes for an empty table, or up to several hours for large tables. If you want to add or remove a replica, we recommend submitting an ``UpdateStack`` operation containing only that change. If you add or delete a replica during an update, we recommend that you don't update any other resources. If your stack fails to update and is rolled back while adding a new replica, you might need to manually delete the replica.
You can create a new global table with as many replicas as needed. You can add or remove replicas after table creation, but you can only add or remove a single replica in each update.
- sse_specification
Specifies the settings to enable server-side encryption.
These settings will be applied to all replicas. If you plan to use customer-managed KMS keys, you must provide a key for each replica using the
ReplicaSpecification.ReplicaSSESpecification
property.
- stream_specification
Specifies the streams settings on your global table.
You must provide a value for this property if your global table contains more than one replica. You can only change the streams settings if your global table has only one replica.
- table_name
A name for the global table.
If you don’t specify a name, AWS CloudFormation generates a unique ID and uses that ID as the table name. For more information, see Name type . .. epigraph:
If you specify a name, you cannot perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name.
- time_to_live_specification
Specifies the time to live (TTL) settings for the table.
This setting will be applied to all replicas.
- write_on_demand_throughput_settings
Sets the write request settings for a global table or a global secondary index.
You must specify this setting if you set the
BillingMode
toPAY_PER_REQUEST
.
- write_provisioned_throughput_settings
Specifies an auto scaling policy for write capacity.
This policy will be applied to all replicas. This setting must be specified if
BillingMode
is set toPROVISIONED
.