CfnGlobalTable
- class aws_cdk.aws_dynamodb.CfnGlobalTable(scope, id, *, 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:
CfnResource
The
AWS::DynamoDB::GlobalTable
resource enables you to create and manage a Version 2019.11.21 global table. This resource cannot be used to create or manage a Version 2017.11.29 global table. For more information, see Global tables .You cannot convert a resource of type
AWS::DynamoDB::Table
into a resource of typeAWS::DynamoDB::GlobalTable
by changing its type in your template. Doing so might result in the deletion of your DynamoDB table.You can instead use the GlobalTable resource to create a new table in a single Region. This will be billed the same as a single Region table. If you later update the stack to add other Regions then Global Tables pricing will apply.
You should be aware of the following behaviors when working with DynamoDB global tables.
The IAM Principal executing the stack operation must have the permissions listed below in all regions where you plan to have a global table replica. The IAM Principal’s permissions should not have restrictions based on IP source address. Some global tables operations (for example, adding a replica) are asynchronous, and require that the IAM Principal is valid until they complete. You should not delete the Principal (user or IAM role) until CloudFormation has finished updating your stack.
dynamodb:CreateTable
dynamodb:UpdateTable
dynamodb:DeleteTable
dynamodb:DescribeContinuousBackups
dynamodb:DescribeContributorInsights
dynamodb:DescribeTable
dynamodb:DescribeTableReplicaAutoScaling
dynamodb:DescribeTimeToLive
dynamodb:ListTables
dynamodb:UpdateTimeToLive
dynamodb:UpdateContributorInsights
dynamodb:UpdateContinuousBackups
dynamodb:ListTagsOfResource
dynamodb:TagResource
dynamodb:UntagResource
dynamodb:BatchWriteItem
dynamodb:CreateTableReplica
dynamodb:DeleteItem
dynamodb:DeleteTableReplica
dynamodb:DisableKinesisStreamingDestination
dynamodb:EnableKinesisStreamingDestination
dynamodb:GetItem
dynamodb:PutItem
dynamodb:Query
dynamodb:Scan
dynamodb:UpdateItem
dynamodb:DescribeTableReplicaAutoScaling
dynamodb:UpdateTableReplicaAutoScaling
iam:CreateServiceLinkedRole
kms:CreateGrant
kms:DescribeKey
application-autoscaling:DeleteScalingPolicy
application-autoscaling:DeleteScheduledAction
application-autoscaling:DeregisterScalableTarget
application-autoscaling:DescribeScalingPolicies
application-autoscaling:DescribeScalableTargets
application-autoscaling:PutScalingPolicy
application-autoscaling:PutScheduledAction
application-autoscaling:RegisterScalableTarget
When using provisioned billing mode, CloudFormation will create an auto scaling policy on each of your replicas to control their write capacities. You must configure this policy using the
WriteProvisionedThroughputSettings
property. CloudFormation will ensure that all replicas have the same write capacity auto scaling property. You cannot directly specify a value for write capacity for a global table.If your table uses provisioned capacity, you must configure auto scaling directly in the
AWS::DynamoDB::GlobalTable
resource. You should not configure additional auto scaling policies on any of the table replicas or global secondary indexes, either via API or viaAWS::ApplicationAutoScaling::ScalableTarget
orAWS::ApplicationAutoScaling::ScalingPolicy
. Doing so might result in unexpected behavior and is unsupported.In AWS CloudFormation , each global table is controlled by a single stack, in a single region, regardless of the number of replicas. When you deploy your template, CloudFormation will create/update all replicas as part of a single stack operation. You should not deploy the same
AWS::DynamoDB::GlobalTable
resource in multiple regions. Doing so will result in errors, and is unsupported. If you deploy your application template in multiple regions, you can use conditions to only create the resource in a single region. Alternatively, you can choose to define yourAWS::DynamoDB::GlobalTable
resources in a stack separate from your application stack, and make sure it is only deployed to a single region.
- See:
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-globaltable.html
- CloudformationResource:
AWS::DynamoDB::GlobalTable
- 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 = dynamodb.CfnGlobalTable(self, "MyCfnGlobalTable", 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 ) ) )
- Parameters:
scope (
Construct
) – Scope in which this resource is defined.id (
str
) – Construct identifier for this resource (unique in its scope).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
.
Methods
- add_deletion_override(path)
Syntactic sugar for
addOverride(path, undefined)
.- Parameters:
path (
str
) – The path of the value to delete.- Return type:
None
- add_dependency(target)
Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
This can be used for resources across stacks (or nested stack) boundaries and the dependency will automatically be transferred to the relevant scope.
- Parameters:
target (
CfnResource
) –- Return type:
None
- add_depends_on(target)
(deprecated) Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
- Parameters:
target (
CfnResource
) –- Deprecated:
use addDependency
- Stability:
deprecated
- Return type:
None
- add_metadata(key, value)
Add a value to the CloudFormation Resource Metadata.
- Parameters:
key (
str
) –value (
Any
) –
- See:
- Return type:
None
Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.
- add_override(path, value)
Adds an override to the synthesized CloudFormation resource.
To add a property override, either use
addPropertyOverride
or prefixpath
with “Properties.” (i.e.Properties.TopicName
).If the override is nested, separate each nested level using a dot (.) in the path parameter. If there is an array as part of the nesting, specify the index in the path.
To include a literal
.
in the property name, prefix with a\
. In most programming languages you will need to write this as"\\."
because the\
itself will need to be escaped.For example:
cfn_resource.add_override("Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes", ["myattribute"]) cfn_resource.add_override("Properties.GlobalSecondaryIndexes.1.ProjectionType", "INCLUDE")
would add the overrides Example:
"Properties": { "GlobalSecondaryIndexes": [ { "Projection": { "NonKeyAttributes": [ "myattribute" ] ... } ... }, { "ProjectionType": "INCLUDE" ... }, ] ... }
The
value
argument toaddOverride
will not be processed or translated in any way. Pass raw JSON values in here with the correct capitalization for CloudFormation. If you pass CDK classes or structs, they will be rendered with lowercased key names, and CloudFormation will reject the template.- Parameters:
path (
str
) –The path of the property, you can use dot notation to override values in complex types. Any intermediate keys will be created as needed.
value (
Any
) –The value. Could be primitive or complex.
- Return type:
None
- add_property_deletion_override(property_path)
Adds an override that deletes the value of a property from the resource definition.
- Parameters:
property_path (
str
) – The path to the property.- Return type:
None
- add_property_override(property_path, value)
Adds an override to a resource property.
Syntactic sugar for
addOverride("Properties.<...>", value)
.- Parameters:
property_path (
str
) – The path of the property.value (
Any
) – The value.
- Return type:
None
- apply_removal_policy(policy=None, *, apply_to_update_replace_policy=None, default=None)
Sets the deletion policy of the resource based on the removal policy specified.
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you’ve removed it from the CDK application or because you’ve made a change that requires the resource to be replaced.
The resource can be deleted (
RemovalPolicy.DESTROY
), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN
). In some cases, a snapshot can be taken of the resource prior to deletion (RemovalPolicy.SNAPSHOT
). A list of resources that support this policy can be found in the following link:- Parameters:
policy (
Optional
[RemovalPolicy
]) –apply_to_update_replace_policy (
Optional
[bool
]) – Apply the same deletion policy to the resource’s “UpdateReplacePolicy”. Default: truedefault (
Optional
[RemovalPolicy
]) – The default policy to apply in case the removal policy is not defined. Default: - Default value is resource specific. To determine the default value for a resource, please consult that specific resource’s documentation.
- See:
- Return type:
None
- get_att(attribute_name, type_hint=None)
Returns a token for an runtime attribute of this resource.
Ideally, use generated attribute accessors (e.g.
resource.arn
), but this can be used for future compatibility in case there is no generated attribute.- Parameters:
attribute_name (
str
) – The name of the attribute.type_hint (
Optional
[ResolutionTypeHint
]) –
- Return type:
- get_metadata(key)
Retrieve a value value from the CloudFormation Resource Metadata.
- Parameters:
key (
str
) –- See:
- Return type:
Any
Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.
- inspect(inspector)
Examines the CloudFormation resource and discloses attributes.
- Parameters:
inspector (
TreeInspector
) – tree inspector to collect and process attributes.- Return type:
None
- obtain_dependencies()
Retrieves an array of resources this resource depends on.
This assembles dependencies on resources across stacks (including nested stacks) automatically.
- Return type:
List
[Union
[Stack
,CfnResource
]]
- obtain_resource_dependencies()
Get a shallow copy of dependencies between this resource and other resources in the same stack.
- Return type:
List
[CfnResource
]
- override_logical_id(new_logical_id)
Overrides the auto-generated logical ID with a specific ID.
- Parameters:
new_logical_id (
str
) – The new logical ID to use for this stack element.- Return type:
None
- remove_dependency(target)
Indicates that this resource no longer depends on another resource.
This can be used for resources across stacks (including nested stacks) and the dependency will automatically be removed from the relevant scope.
- Parameters:
target (
CfnResource
) –- Return type:
None
- replace_dependency(target, new_target)
Replaces one dependency with another.
- Parameters:
target (
CfnResource
) – The dependency to replace.new_target (
CfnResource
) – The new dependency to add.
- Return type:
None
- to_string()
Returns a string representation of this construct.
- Return type:
str
- Returns:
a string representation of this resource
Attributes
- CFN_RESOURCE_TYPE_NAME = 'AWS::DynamoDB::GlobalTable'
- attr_arn
The Amazon Resource Name (ARN) of the DynamoDB table, such as
arn:aws:dynamodb:us-east-2:123456789012:table/myDynamoDBTable
.The ARN returned is that of the replica in the region the stack is deployed to.
- CloudformationAttribute:
Arn
- attr_stream_arn
The ARN of the DynamoDB stream, such as
arn:aws:dynamodb:us-east-1:123456789012:table/testddbstack-myDynamoDBTable-012A1SL7SMP5Q/stream/2015-11-30T20:10:00.000
. TheStreamArn
returned is that of the replica in the region the stack is deployed to.You must specify the
StreamSpecification
property to use this attribute.- CloudformationAttribute:
StreamArn
- attr_table_id
Unique identifier for the table, such as
a123b456-01ab-23cd-123a-111222aaabbb
.The
TableId
returned is that of the replica in the region the stack is deployed to.- CloudformationAttribute:
TableId
- attribute_definitions
A list of attributes that describe the key schema for the global table and indexes.
- billing_mode
Specifies how you are charged for read and write throughput and how you manage capacity.
Valid values are:.
- cfn_options
Options for this resource, such as condition, update policy etc.
- cfn_resource_type
AWS resource type.
- creation_stack
return:
the stack trace of the point where this Resource was created from, sourced from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most node +internal+ entries filtered.
- global_secondary_indexes
Global secondary indexes to be created on the global table.
- key_schema
Specifies the attributes that make up the primary key for the table.
- local_secondary_indexes
Local secondary indexes to be created on the table.
- logical_id
The logical ID for this CloudFormation stack element.
The logical ID of the element is calculated from the path of the resource node in the construct tree.
To override this value, use
overrideLogicalId(newLogicalId)
.- Returns:
the logical ID as a stringified token. This value will only get resolved during synthesis.
- node
The tree node.
- ref
Return a string that will be resolved to a CloudFormation
{ Ref }
for this element.If, by any chance, the intrinsic reference of a resource is not a string, you could coerce it to an IResolvable through
Lazy.any({ produce: resource.ref })
.
- replicas
Specifies the list of replicas for your global table.
- sse_specification
Specifies the settings to enable server-side encryption.
- stack
The stack in which this element is defined.
CfnElements must be defined within a stack scope (directly or indirectly).
- stream_specification
Specifies the streams settings on your global table.
- table_name
A name for the global table.
- time_to_live_specification
Specifies the time to live (TTL) settings for the table.
- write_on_demand_throughput_settings
Sets the write request settings for a global table or a global secondary index.
- write_provisioned_throughput_settings
Specifies an auto scaling policy for write capacity.
Static Methods
- classmethod is_cfn_element(x)
Returns
true
if a construct is a stack element (i.e. part of the synthesized cloudformation template).Uses duck-typing instead of
instanceof
to allow stack elements from different versions of this library to be included in the same stack.- Parameters:
x (
Any
) –- Return type:
bool
- Returns:
The construct as a stack element or undefined if it is not a stack element.
- classmethod is_cfn_resource(x)
Check whether the given object is a CfnResource.
- Parameters:
x (
Any
) –- Return type:
bool
- classmethod is_construct(x)
Checks if
x
is a construct.Use this method instead of
instanceof
to properly detectConstruct
instances, even when the construct library is symlinked.Explanation: in JavaScript, multiple copies of the
constructs
library on disk are seen as independent, completely different libraries. As a consequence, the classConstruct
in each copy of theconstructs
library is seen as a different class, and an instance of one class will not test asinstanceof
the other class.npm install
will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of theconstructs
library can be accidentally installed, andinstanceof
will behave unpredictably. It is safest to avoid usinginstanceof
, and using this type-testing method instead.- Parameters:
x (
Any
) – Any object.- Return type:
bool
- Returns:
true if
x
is an object created from a class which extendsConstruct
.
AttributeDefinitionProperty
- class CfnGlobalTable.AttributeDefinitionProperty(*, attribute_name, attribute_type)
Bases:
object
Represents an attribute for describing the schema for the table and indexes.
- Parameters:
attribute_name (
str
) – A name for the attribute.attribute_type (
str
) – The data type for the attribute, where:. -S
- the attribute is of type String -N
- the attribute is of type Number -B
- the attribute is of type Binary
- See:
- 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 attribute_definition_property = dynamodb.CfnGlobalTable.AttributeDefinitionProperty( attribute_name="attributeName", attribute_type="attributeType" )
Attributes
- attribute_name
A name for the attribute.
- attribute_type
.
S
- the attribute is of type StringN
- the attribute is of type NumberB
- the attribute is of type Binary
- See:
- Type:
The data type for the attribute, where
CapacityAutoScalingSettingsProperty
- class CfnGlobalTable.CapacityAutoScalingSettingsProperty(*, max_capacity, min_capacity, target_tracking_scaling_policy_configuration, seed_capacity=None)
Bases:
object
Configures a scalable target and an autoscaling policy for a table or global secondary index’s read or write capacity.
- Parameters:
max_capacity (
Union
[int
,float
]) – The maximum provisioned capacity units for the global table.min_capacity (
Union
[int
,float
]) – The minimum provisioned capacity units for the global table.target_tracking_scaling_policy_configuration (
Union
[IResolvable
,TargetTrackingScalingPolicyConfigurationProperty
,Dict
[str
,Any
]]) – Defines a target tracking scaling policy.seed_capacity (
Union
[int
,float
,None
]) – When switching billing mode fromPAY_PER_REQUEST
toPROVISIONED
, DynamoDB requires you to specify read and write capacity unit values for the table and for each global secondary index. These values will be applied to all replicas. The table will use these provisioned values until CloudFormation creates the autoscaling policies you configured in your template. CloudFormation cannot determine what capacity the table and its global secondary indexes will require in this time period, since they are application-dependent. If you want to switch a table’s billing mode fromPAY_PER_REQUEST
toPROVISIONED
, you must specify a value for this property for each autoscaled resource. If you specify different values for the same resource in different regions, CloudFormation will use the highest value found in either theSeedCapacity
orReadCapacityUnits
properties. For example, if your global secondary indexmyGSI
has aSeedCapacity
of 10 in us-east-1 and a fixedReadCapacityUnits
of 20 in eu-west-1, CloudFormation will initially set the read capacity formyGSI
to 20. Note that if you disableScaleIn
formyGSI
in us-east-1, its read capacity units might not be set back to 10. You must also specify a value forSeedCapacity
when you plan to switch a table’s billing mode fromPROVISIONED
toPAY_PER_REQUEST
, because CloudFormation might need to roll back the operation (reverting the billing mode toPROVISIONED
) and this cannot succeed without specifying a value forSeedCapacity
.
- See:
- 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 capacity_auto_scaling_settings_property = 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
- max_capacity
The maximum provisioned capacity units for the global table.
- min_capacity
The minimum provisioned capacity units for the global table.
- seed_capacity
When switching billing mode from
PAY_PER_REQUEST
toPROVISIONED
, DynamoDB requires you to specify read and write capacity unit values for the table and for each global secondary index.These values will be applied to all replicas. The table will use these provisioned values until CloudFormation creates the autoscaling policies you configured in your template. CloudFormation cannot determine what capacity the table and its global secondary indexes will require in this time period, since they are application-dependent.
If you want to switch a table’s billing mode from
PAY_PER_REQUEST
toPROVISIONED
, you must specify a value for this property for each autoscaled resource. If you specify different values for the same resource in different regions, CloudFormation will use the highest value found in either theSeedCapacity
orReadCapacityUnits
properties. For example, if your global secondary indexmyGSI
has aSeedCapacity
of 10 in us-east-1 and a fixedReadCapacityUnits
of 20 in eu-west-1, CloudFormation will initially set the read capacity formyGSI
to 20. Note that if you disableScaleIn
formyGSI
in us-east-1, its read capacity units might not be set back to 10.You must also specify a value for
SeedCapacity
when you plan to switch a table’s billing mode fromPROVISIONED
toPAY_PER_REQUEST
, because CloudFormation might need to roll back the operation (reverting the billing mode toPROVISIONED
) and this cannot succeed without specifying a value forSeedCapacity
.
- target_tracking_scaling_policy_configuration
Defines a target tracking scaling policy.
ContributorInsightsSpecificationProperty
- class CfnGlobalTable.ContributorInsightsSpecificationProperty(*, enabled)
Bases:
object
Configures contributor insights settings for a replica or one of its indexes.
- Parameters:
enabled (
Union
[bool
,IResolvable
]) – Indicates whether CloudWatch Contributor Insights are to be enabled (true) or disabled (false).- See:
- 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 contributor_insights_specification_property = dynamodb.CfnGlobalTable.ContributorInsightsSpecificationProperty( enabled=False )
Attributes
- enabled
Indicates whether CloudWatch Contributor Insights are to be enabled (true) or disabled (false).
GlobalSecondaryIndexProperty
- class CfnGlobalTable.GlobalSecondaryIndexProperty(*, index_name, key_schema, projection, write_on_demand_throughput_settings=None, write_provisioned_throughput_settings=None)
Bases:
object
Allows you to specify a global secondary index for the global table.
The index will be defined on all replicas.
- Parameters:
index_name (
str
) – The name of the global secondary index. The name must be unique among all other indexes on this table.key_schema (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,KeySchemaProperty
,Dict
[str
,Any
]]]]) – The complete key schema for a global secondary index, which consists of one or more pairs of attribute names and key types: -HASH
- partition key -RANGE
- sort key > The partition key of an item is also known as its hash attribute . The term “hash attribute” derives from DynamoDB’s usage of an internal hash function to evenly distribute data items across partitions, based on their partition key values. .. epigraph:: The sort key of an item is also known as its range attribute . The term “range attribute” derives from the way DynamoDB stores items with the same partition key physically close together, in sorted order by the sort key value.projection (
Union
[IResolvable
,ProjectionProperty
,Dict
[str
,Any
]]) – Represents attributes that are copied (projected) from the table into the global secondary index. These are in addition to the primary key attributes and index key attributes, which are automatically projected.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
]) – Defines write capacity settings for the global secondary index. You must specify a value for this property if the table’sBillingMode
isPROVISIONED
. All replicas will have the same write capacity settings for this global secondary index.
- See:
- 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 global_secondary_index_property = 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 ) ) )
Attributes
- index_name
The name of the global secondary index.
The name must be unique among all other indexes on this table.
- key_schema
HASH
- partition key -RANGE
- sort key > The partition key of an item is also known as its hash attribute .
The term “hash attribute” derives from DynamoDB’s usage of an internal hash function to evenly distribute data items across partitions, based on their partition key values. .. epigraph:
The sort key of an item is also known as its *range attribute* . The term "range attribute" derives from the way DynamoDB stores items with the same partition key physically close together, in sorted order by the sort key value.
- See:
- Type:
The complete key schema for a global secondary index, which consists of one or more pairs of attribute names and key types
- projection
Represents attributes that are copied (projected) from the table into the global secondary index.
These are in addition to the primary key attributes and index key attributes, which are automatically projected.
- 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
Defines write capacity settings for the global secondary index.
You must specify a value for this property if the table’s
BillingMode
isPROVISIONED
. All replicas will have the same write capacity settings for this global secondary index.
KeySchemaProperty
- class CfnGlobalTable.KeySchemaProperty(*, attribute_name, key_type)
Bases:
object
Represents a single element of a key schema.
A key schema specifies the attributes that make up the primary key of a table, or the key attributes of an index.
A
KeySchemaElement
represents exactly one attribute of the primary key. For example, a simple primary key would be represented by oneKeySchemaElement
(for the partition key). A composite primary key would require oneKeySchemaElement
for the partition key, and anotherKeySchemaElement
for the sort key.A
KeySchemaElement
must be a scalar, top-level attribute (not a nested attribute). The data type must be one of String, Number, or Binary. The attribute cannot be nested within a List or a Map.- Parameters:
attribute_name (
str
) – The name of a key attribute.key_type (
str
) – The role that this key attribute will assume:. -HASH
- partition key -RANGE
- sort key .. epigraph:: The partition key of an item is also known as its hash attribute . The term “hash attribute” derives from DynamoDB’s usage of an internal hash function to evenly distribute data items across partitions, based on their partition key values. The sort key of an item is also known as its range attribute . The term “range attribute” derives from the way DynamoDB stores items with the same partition key physically close together, in sorted order by the sort key value.
- See:
- 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 key_schema_property = dynamodb.CfnGlobalTable.KeySchemaProperty( attribute_name="attributeName", key_type="keyType" )
Attributes
- attribute_name
The name of a key attribute.
- key_type
.
HASH
- partition keyRANGE
- sort key
The partition key of an item is also known as its hash attribute . The term “hash attribute” derives from DynamoDB’s usage of an internal hash function to evenly distribute data items across partitions, based on their partition key values.
The sort key of an item is also known as its range attribute . The term “range attribute” derives from the way DynamoDB stores items with the same partition key physically close together, in sorted order by the sort key value.
- See:
- Type:
The role that this key attribute will assume
KinesisStreamSpecificationProperty
- class CfnGlobalTable.KinesisStreamSpecificationProperty(*, stream_arn, approximate_creation_date_time_precision=None)
Bases:
object
The Kinesis Data Streams configuration for the specified global table replica.
- Parameters:
stream_arn (
str
) – The ARN for a specific Kinesis data stream.approximate_creation_date_time_precision (
Optional
[str
]) – The precision for the time and date that the stream was created.
- See:
- 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 kinesis_stream_specification_property = dynamodb.CfnGlobalTable.KinesisStreamSpecificationProperty( stream_arn="streamArn", # the properties below are optional approximate_creation_date_time_precision="approximateCreationDateTimePrecision" )
Attributes
- approximate_creation_date_time_precision
The precision for the time and date that the stream was created.
- stream_arn
The ARN for a specific Kinesis data stream.
LocalSecondaryIndexProperty
- class CfnGlobalTable.LocalSecondaryIndexProperty(*, index_name, key_schema, projection)
Bases:
object
Represents the properties of a local secondary index.
A local secondary index can only be created when its parent table is created.
- Parameters:
index_name (
str
) – The name of the local secondary index. The name must be unique among all other indexes on this table.key_schema (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,KeySchemaProperty
,Dict
[str
,Any
]]]]) – The complete key schema for the local secondary index, consisting of one or more pairs of attribute names and key types: -HASH
- partition key -RANGE
- sort key > The partition key of an item is also known as its hash attribute . The term “hash attribute” derives from DynamoDB’s usage of an internal hash function to evenly distribute data items across partitions, based on their partition key values. .. epigraph:: The sort key of an item is also known as its range attribute . The term “range attribute” derives from the way DynamoDB stores items with the same partition key physically close together, in sorted order by the sort key value.projection (
Union
[IResolvable
,ProjectionProperty
,Dict
[str
,Any
]]) – Represents attributes that are copied (projected) from the table into the local secondary index. These are in addition to the primary key attributes and index key attributes, which are automatically projected.
- See:
- 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 local_secondary_index_property = 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" ) )
Attributes
- index_name
The name of the local secondary index.
The name must be unique among all other indexes on this table.
- key_schema
HASH
- partition key -RANGE
- sort key > The partition key of an item is also known as its hash attribute .
The term “hash attribute” derives from DynamoDB’s usage of an internal hash function to evenly distribute data items across partitions, based on their partition key values. .. epigraph:
The sort key of an item is also known as its *range attribute* . The term "range attribute" derives from the way DynamoDB stores items with the same partition key physically close together, in sorted order by the sort key value.
- See:
- Type:
The complete key schema for the local secondary index, consisting of one or more pairs of attribute names and key types
- projection
Represents attributes that are copied (projected) from the table into the local secondary index.
These are in addition to the primary key attributes and index key attributes, which are automatically projected.
PointInTimeRecoverySpecificationProperty
- class CfnGlobalTable.PointInTimeRecoverySpecificationProperty(*, point_in_time_recovery_enabled=None)
Bases:
object
Represents the settings used to enable point in time recovery.
- Parameters:
point_in_time_recovery_enabled (
Union
[bool
,IResolvable
,None
]) – Indicates whether point in time recovery is enabled (true) or disabled (false) on the table.- See:
- 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 point_in_time_recovery_specification_property = dynamodb.CfnGlobalTable.PointInTimeRecoverySpecificationProperty( point_in_time_recovery_enabled=False )
Attributes
- point_in_time_recovery_enabled
Indicates whether point in time recovery is enabled (true) or disabled (false) on the table.
ProjectionProperty
- class CfnGlobalTable.ProjectionProperty(*, non_key_attributes=None, projection_type=None)
Bases:
object
Represents attributes that are copied (projected) from the table into an index.
These are in addition to the primary key attributes and index key attributes, which are automatically projected.
- Parameters:
non_key_attributes (
Optional
[Sequence
[str
]]) – Represents the non-key attribute names which will be projected into the index. For local secondary indexes, the total count ofNonKeyAttributes
summed across all of the local secondary indexes, must not exceed 100. If you project the same attribute into two different indexes, this counts as two distinct attributes when determining the total.projection_type (
Optional
[str
]) – The set of attributes that are projected into the index:. -KEYS_ONLY
- Only the index and primary keys are projected into the index. -INCLUDE
- In addition to the attributes described inKEYS_ONLY
, the secondary index will include other non-key attributes that you specify. -ALL
- All of the table attributes are projected into the index. When using the DynamoDB console,ALL
is selected by default.
- See:
- 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 projection_property = dynamodb.CfnGlobalTable.ProjectionProperty( non_key_attributes=["nonKeyAttributes"], projection_type="projectionType" )
Attributes
- non_key_attributes
Represents the non-key attribute names which will be projected into the index.
For local secondary indexes, the total count of
NonKeyAttributes
summed across all of the local secondary indexes, must not exceed 100. If you project the same attribute into two different indexes, this counts as two distinct attributes when determining the total.
- projection_type
.
KEYS_ONLY
- Only the index and primary keys are projected into the index.INCLUDE
- In addition to the attributes described inKEYS_ONLY
, the secondary index will include other non-key attributes that you specify.ALL
- All of the table attributes are projected into the index.
When using the DynamoDB console,
ALL
is selected by default.- See:
- Type:
The set of attributes that are projected into the index
ReadOnDemandThroughputSettingsProperty
- class CfnGlobalTable.ReadOnDemandThroughputSettingsProperty(*, max_read_request_units=None)
Bases:
object
Sets the read request settings for a replica table or a replica global secondary index.
You must specify this setting if you set the
BillingMode
toPAY_PER_REQUEST
.- Parameters:
max_read_request_units (
Union
[int
,float
,None
]) – Maximum number of read request units for the specified replica of a global table.- See:
- 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 read_on_demand_throughput_settings_property = dynamodb.CfnGlobalTable.ReadOnDemandThroughputSettingsProperty( max_read_request_units=123 )
Attributes
- max_read_request_units
Maximum number of read request units for the specified replica of a global table.
ReadProvisionedThroughputSettingsProperty
- class CfnGlobalTable.ReadProvisionedThroughputSettingsProperty(*, read_capacity_auto_scaling_settings=None, read_capacity_units=None)
Bases:
object
Allows you to specify the read capacity settings for a replica table or a replica global secondary index when the
BillingMode
is set toPROVISIONED
.You must specify a value for either
ReadCapacityUnits
orReadCapacityAutoScalingSettings
, but not both. You can switch between fixed capacity and auto scaling.- Parameters:
read_capacity_auto_scaling_settings (
Union
[IResolvable
,CapacityAutoScalingSettingsProperty
,Dict
[str
,Any
],None
]) – Specifies auto scaling settings for the replica table or global secondary index.read_capacity_units (
Union
[int
,float
,None
]) – Specifies a fixed read capacity for the replica table or global secondary index.
- See:
- 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 read_provisioned_throughput_settings_property = 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 )
Attributes
- read_capacity_auto_scaling_settings
Specifies auto scaling settings for the replica table or global secondary index.
- read_capacity_units
Specifies a fixed read capacity for the replica table or global secondary index.
ReplicaGlobalSecondaryIndexSpecificationProperty
- class CfnGlobalTable.ReplicaGlobalSecondaryIndexSpecificationProperty(*, index_name, contributor_insights_specification=None, read_on_demand_throughput_settings=None, read_provisioned_throughput_settings=None)
Bases:
object
Represents the properties of a global secondary index that can be set on a per-replica basis.
- Parameters:
index_name (
str
) – The name of the global secondary index. The name must be unique among all other indexes on this table.contributor_insights_specification (
Union
[IResolvable
,ContributorInsightsSpecificationProperty
,Dict
[str
,Any
],None
]) – Updates the status for contributor insights for a specific table or index. CloudWatch Contributor Insights for DynamoDB graphs display the partition key and (if applicable) sort key of frequently accessed items and frequently throttled items in plaintext. If you require the use of AWS Key Management Service (KMS) to encrypt this table’s partition key and sort key data with an AWS managed key or customer managed key, you should not enable CloudWatch Contributor Insights for DynamoDB for this table.read_on_demand_throughput_settings (
Union
[IResolvable
,ReadOnDemandThroughputSettingsProperty
,Dict
[str
,Any
],None
]) – Sets the read request settings for a replica global secondary index. You must specify this setting if you set theBillingMode
toPAY_PER_REQUEST
.read_provisioned_throughput_settings (
Union
[IResolvable
,ReadProvisionedThroughputSettingsProperty
,Dict
[str
,Any
],None
]) – Allows you to specify the read capacity settings for a replica global secondary index when theBillingMode
is set toPROVISIONED
.
- See:
- 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 replica_global_secondary_index_specification_property = 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 ) )
Attributes
- contributor_insights_specification
Updates the status for contributor insights for a specific table or index.
CloudWatch Contributor Insights for DynamoDB graphs display the partition key and (if applicable) sort key of frequently accessed items and frequently throttled items in plaintext. If you require the use of AWS Key Management Service (KMS) to encrypt this table’s partition key and sort key data with an AWS managed key or customer managed key, you should not enable CloudWatch Contributor Insights for DynamoDB for this table.
- index_name
The name of the global secondary index.
The name must be unique among all other indexes on this table.
- read_on_demand_throughput_settings
Sets the read request settings for a replica global secondary index.
You must specify this setting if you set the
BillingMode
toPAY_PER_REQUEST
.
- read_provisioned_throughput_settings
Allows you to specify the read capacity settings for a replica global secondary index when the
BillingMode
is set toPROVISIONED
.
ReplicaSSESpecificationProperty
- class CfnGlobalTable.ReplicaSSESpecificationProperty(*, kms_master_key_id)
Bases:
object
Allows you to specify a KMS key identifier to be used for server-side encryption.
The key can be specified via ARN, key ID, or alias. The key must be created in the same region as the replica.
- Parameters:
kms_master_key_id (
str
) – The AWS KMS key that should be used for the AWS KMS encryption. To specify a key, use its key ID, Amazon Resource Name (ARN), alias name, or alias ARN. Note that you should only provide this parameter if the key is different from the default DynamoDB keyalias/aws/dynamodb
.- See:
- 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 replica_sSESpecification_property = dynamodb.CfnGlobalTable.ReplicaSSESpecificationProperty( kms_master_key_id="kmsMasterKeyId" )
Attributes
- kms_master_key_id
The AWS KMS key that should be used for the AWS KMS encryption.
To specify a key, use its key ID, Amazon Resource Name (ARN), alias name, or alias ARN. Note that you should only provide this parameter if the key is different from the default DynamoDB key
alias/aws/dynamodb
.
ReplicaSpecificationProperty
- class CfnGlobalTable.ReplicaSpecificationProperty(*, region, contributor_insights_specification=None, deletion_protection_enabled=None, global_secondary_indexes=None, kinesis_stream_specification=None, point_in_time_recovery_specification=None, read_on_demand_throughput_settings=None, read_provisioned_throughput_settings=None, replica_stream_specification=None, resource_policy=None, sse_specification=None, table_class=None, tags=None)
Bases:
object
Defines settings specific to a single replica of a global table.
- Parameters:
region (
str
) – The region in which this replica exists.contributor_insights_specification (
Union
[IResolvable
,ContributorInsightsSpecificationProperty
,Dict
[str
,Any
],None
]) – The settings used to enable or disable CloudWatch Contributor Insights for the specified replica. When not specified, defaults to contributor insights disabled for the replica.deletion_protection_enabled (
Union
[bool
,IResolvable
,None
]) – Determines if a replica is protected from deletion. When enabled, the table cannot be deleted by any user or process. This setting is disabled by default. For more information, see Using deletion protection in the Amazon DynamoDB Developer Guide .global_secondary_indexes (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,ReplicaGlobalSecondaryIndexSpecificationProperty
,Dict
[str
,Any
]]],None
]) – Defines additional settings for the global secondary indexes of this replica.kinesis_stream_specification (
Union
[IResolvable
,KinesisStreamSpecificationProperty
,Dict
[str
,Any
],None
]) – Defines the Kinesis Data Streams configuration for the specified replica.point_in_time_recovery_specification (
Union
[IResolvable
,PointInTimeRecoverySpecificationProperty
,Dict
[str
,Any
],None
]) – The settings used to enable point in time recovery. When not specified, defaults to point in time recovery disabled for the replica.read_on_demand_throughput_settings (
Union
[IResolvable
,ReadOnDemandThroughputSettingsProperty
,Dict
[str
,Any
],None
]) – Sets read request settings for the replica table.read_provisioned_throughput_settings (
Union
[IResolvable
,ReadProvisionedThroughputSettingsProperty
,Dict
[str
,Any
],None
]) – Defines read capacity settings for the replica table.replica_stream_specification (
Union
[IResolvable
,ReplicaStreamSpecificationProperty
,Dict
[str
,Any
],None
]) – Represents the DynamoDB Streams configuration for a global table replica.resource_policy (
Union
[IResolvable
,ResourcePolicyProperty
,Dict
[str
,Any
],None
]) – A resource-based policy document that contains permissions to add to the specified replica of a DynamoDB global table. Resource-based policies let you define access permissions by specifying who has access to each resource, and the actions they are allowed to perform on each resource. In a CloudFormation template, you can provide the policy in JSON or YAML format because CloudFormation converts YAML to JSON before submitting it to DynamoDB . For more information about resource-based policies, see Using resource-based policies for DynamoDB and Resource-based policy examples .sse_specification (
Union
[IResolvable
,ReplicaSSESpecificationProperty
,Dict
[str
,Any
],None
]) – Allows you to specify a customer-managed key for the replica. When using customer-managed keys for server-side encryption, this property must have a value in all replicas.table_class (
Optional
[str
]) – The table class of the specified table. Valid values areSTANDARD
andSTANDARD_INFREQUENT_ACCESS
.tags (
Optional
[Sequence
[Union
[CfnTag
,Dict
[str
,Any
]]]]) – An array of key-value pairs to apply to this replica. For more information, see Tag .
- See:
- 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 replica_specification_property = 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" )] )
Attributes
- contributor_insights_specification
The settings used to enable or disable CloudWatch Contributor Insights for the specified replica.
When not specified, defaults to contributor insights disabled for the replica.
- deletion_protection_enabled
Determines if a replica is protected from deletion.
When enabled, the table cannot be deleted by any user or process. This setting is disabled by default. For more information, see Using deletion protection in the Amazon DynamoDB Developer Guide .
- global_secondary_indexes
Defines additional settings for the global secondary indexes of this replica.
- kinesis_stream_specification
Defines the Kinesis Data Streams configuration for the specified replica.
- point_in_time_recovery_specification
The settings used to enable point in time recovery.
When not specified, defaults to point in time recovery disabled for the replica.
- read_on_demand_throughput_settings
Sets read request settings for the replica table.
- read_provisioned_throughput_settings
Defines read capacity settings for the replica table.
- region
The region in which this replica exists.
- replica_stream_specification
Represents the DynamoDB Streams configuration for a global table replica.
- resource_policy
A resource-based policy document that contains permissions to add to the specified replica of a DynamoDB global table.
Resource-based policies let you define access permissions by specifying who has access to each resource, and the actions they are allowed to perform on each resource.
In a CloudFormation template, you can provide the policy in JSON or YAML format because CloudFormation converts YAML to JSON before submitting it to DynamoDB . For more information about resource-based policies, see Using resource-based policies for DynamoDB and Resource-based policy examples .
- sse_specification
Allows you to specify a customer-managed key for the replica.
When using customer-managed keys for server-side encryption, this property must have a value in all replicas.
- table_class
The table class of the specified table.
Valid values are
STANDARD
andSTANDARD_INFREQUENT_ACCESS
.
ReplicaStreamSpecificationProperty
- class CfnGlobalTable.ReplicaStreamSpecificationProperty(*, resource_policy)
Bases:
object
Represents the DynamoDB Streams configuration for a global table replica.
- Parameters:
resource_policy (
Union
[IResolvable
,ResourcePolicyProperty
,Dict
[str
,Any
]]) –A resource-based policy document that contains the permissions for the specified stream of a DynamoDB global table replica. Resource-based policies let you define access permissions by specifying who has access to each resource, and the actions they are allowed to perform on each resource. In a CloudFormation template, you can provide the policy in JSON or YAML format because CloudFormation converts YAML to JSON before submitting it to DynamoDB . For more information about resource-based policies, see Using resource-based policies for DynamoDB and Resource-based policy examples . You can update the
ResourcePolicy
property if you’ve specified more than one table using the AWS ::DynamoDB::GlobalTable resource.- See:
- 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 replica_stream_specification_property = dynamodb.CfnGlobalTable.ReplicaStreamSpecificationProperty( resource_policy=dynamodb.CfnGlobalTable.ResourcePolicyProperty( policy_document=policy_document ) )
Attributes
- resource_policy
A resource-based policy document that contains the permissions for the specified stream of a DynamoDB global table replica.
Resource-based policies let you define access permissions by specifying who has access to each resource, and the actions they are allowed to perform on each resource.
In a CloudFormation template, you can provide the policy in JSON or YAML format because CloudFormation converts YAML to JSON before submitting it to DynamoDB . For more information about resource-based policies, see Using resource-based policies for DynamoDB and Resource-based policy examples .
You can update the
ResourcePolicy
property if you’ve specified more than one table using the AWS ::DynamoDB::GlobalTable resource.
ResourcePolicyProperty
- class CfnGlobalTable.ResourcePolicyProperty(*, policy_document)
Bases:
object
Creates or updates a resource-based policy document that contains the permissions for DynamoDB resources, such as a table, its indexes, and stream.
Resource-based policies let you define access permissions by specifying who has access to each resource, and the actions they are allowed to perform on each resource.
In a CloudFormation template, you can provide the policy in JSON or YAML format because CloudFormation converts YAML to JSON before submitting it to DynamoDB . For more information about resource-based policies, see Using resource-based policies for DynamoDB and Resource-based policy examples .
While defining resource-based policies in your CloudFormation templates, the following considerations apply:
The maximum size supported for a resource-based policy document in JSON format is 20 KB. DynamoDB counts whitespaces when calculating the size of a policy against this limit.
Resource-based policies don’t support drift detection . If you update a policy outside of the CloudFormation stack template, you’ll need to update the CloudFormation stack with the changes.
Resource-based policies don’t support out-of-band changes. If you add, update, or delete a policy outside of the CloudFormation template, the change won’t be overwritten if there are no changes to the policy within the template.
For example, say that your template contains a resource-based policy, which you later update outside of the template. If you don’t make any changes to the policy in the template, the updated policy in DynamoDB won’t be synced with the policy in the template.
Conversely, say that your template doesn’t contain a resource-based policy, but you add a policy outside of the template. This policy won’t be removed from DynamoDB as long as you don’t add it to the template. When you add a policy to the template and update the stack, the existing policy in DynamoDB will be updated to match the one defined in the template.
Within a resource-based policy, if the action for a DynamoDB service-linked role (SLR) to replicate data for a global table is denied, adding or deleting a replica will fail with an error.
The AWS ::DynamoDB::GlobalTable resource doesn’t support creating a replica in the same stack update in Regions other than the Region where you deploy the stack update.
For a full list of all considerations, see Resource-based policy considerations .
- Parameters:
policy_document (
Any
) –A resource-based policy document that contains permissions to add to the specified DynamoDB table, its indexes, and stream. In a CloudFormation template, you can provide the policy in JSON or YAML format because CloudFormation converts YAML to JSON before submitting it to DynamoDB . For more information about resource-based policies, see Using resource-based policies for DynamoDB and Resource-based policy examples .
- See:
- 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 resource_policy_property = dynamodb.CfnGlobalTable.ResourcePolicyProperty( policy_document=policy_document )
Attributes
- policy_document
A resource-based policy document that contains permissions to add to the specified DynamoDB table, its indexes, and stream.
In a CloudFormation template, you can provide the policy in JSON or YAML format because CloudFormation converts YAML to JSON before submitting it to DynamoDB . For more information about resource-based policies, see Using resource-based policies for DynamoDB and Resource-based policy examples .
SSESpecificationProperty
- class CfnGlobalTable.SSESpecificationProperty(*, sse_enabled, sse_type=None)
Bases:
object
Represents the settings used to enable server-side encryption.
- Parameters:
sse_enabled (
Union
[bool
,IResolvable
]) – Indicates whether server-side encryption is performed using an AWS managed key or an AWS owned key. If enabled (true), server-side encryption type is set to KMS and an AWS managed key is used ( AWS KMS charges apply). If disabled (false) or not specified,server-side encryption is set to an AWS owned key. If you choose to use KMS encryption, you can also use customer managed KMS keys by specifying them in theReplicaSpecification.SSESpecification
object. You cannot mix AWS managed and customer managed KMS keys.sse_type (
Optional
[str
]) – Server-side encryption type. The only supported value is:. -KMS
- Server-side encryption that uses AWS Key Management Service . The key is stored in your account and is managed by AWS KMS ( AWS KMS charges apply).
- See:
- 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 s_sESpecification_property = dynamodb.CfnGlobalTable.SSESpecificationProperty( sse_enabled=False, # the properties below are optional sse_type="sseType" )
Attributes
- sse_enabled
Indicates whether server-side encryption is performed using an AWS managed key or an AWS owned key.
If enabled (true), server-side encryption type is set to KMS and an AWS managed key is used ( AWS KMS charges apply). If disabled (false) or not specified,server-side encryption is set to an AWS owned key. If you choose to use KMS encryption, you can also use customer managed KMS keys by specifying them in the
ReplicaSpecification.SSESpecification
object. You cannot mix AWS managed and customer managed KMS keys.
- sse_type
.
KMS
- Server-side encryption that uses AWS Key Management Service . The key is stored in your account and is managed by AWS KMS ( AWS KMS charges apply).
- See:
- Type:
Server-side encryption type. The only supported value is
StreamSpecificationProperty
- class CfnGlobalTable.StreamSpecificationProperty(*, stream_view_type)
Bases:
object
Represents the DynamoDB Streams configuration for a table in DynamoDB.
You can only modify this value if your
AWS::DynamoDB::GlobalTable
contains only one entry inReplicas
. You must specify a value for this property if yourAWS::DynamoDB::GlobalTable
contains more than one replica.- Parameters:
stream_view_type (
str
) – When an item in the table is modified,StreamViewType
determines what information is written to the stream for this table. Valid values forStreamViewType
are: -KEYS_ONLY
- Only the key attributes of the modified item are written to the stream. -NEW_IMAGE
- The entire item, as it appears after it was modified, is written to the stream. -OLD_IMAGE
- The entire item, as it appeared before it was modified, is written to the stream. -NEW_AND_OLD_IMAGES
- Both the new and the old item images of the item are written to the stream.- See:
- 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 stream_specification_property = dynamodb.CfnGlobalTable.StreamSpecificationProperty( stream_view_type="streamViewType" )
Attributes
- stream_view_type
When an item in the table is modified,
StreamViewType
determines what information is written to the stream for this table.Valid values for
StreamViewType
are:KEYS_ONLY
- Only the key attributes of the modified item are written to the stream.NEW_IMAGE
- The entire item, as it appears after it was modified, is written to the stream.OLD_IMAGE
- The entire item, as it appeared before it was modified, is written to the stream.NEW_AND_OLD_IMAGES
- Both the new and the old item images of the item are written to the stream.
TargetTrackingScalingPolicyConfigurationProperty
- class CfnGlobalTable.TargetTrackingScalingPolicyConfigurationProperty(*, target_value, disable_scale_in=None, scale_in_cooldown=None, scale_out_cooldown=None)
Bases:
object
Defines a target tracking scaling policy.
- Parameters:
target_value (
Union
[int
,float
]) – Defines a target value for the scaling policy.disable_scale_in (
Union
[bool
,IResolvable
,None
]) – Indicates whether scale in by the target tracking scaling policy is disabled. The default value isfalse
.scale_in_cooldown (
Union
[int
,float
,None
]) – The amount of time, in seconds, after a scale-in activity completes before another scale-in activity can start.scale_out_cooldown (
Union
[int
,float
,None
]) – The amount of time, in seconds, after a scale-out activity completes before another scale-out activity can start.
- See:
- 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 target_tracking_scaling_policy_configuration_property = dynamodb.CfnGlobalTable.TargetTrackingScalingPolicyConfigurationProperty( target_value=123, # the properties below are optional disable_scale_in=False, scale_in_cooldown=123, scale_out_cooldown=123 )
Attributes
- disable_scale_in
Indicates whether scale in by the target tracking scaling policy is disabled.
The default value is
false
.
- scale_in_cooldown
The amount of time, in seconds, after a scale-in activity completes before another scale-in activity can start.
- scale_out_cooldown
The amount of time, in seconds, after a scale-out activity completes before another scale-out activity can start.
- target_value
Defines a target value for the scaling policy.
TimeToLiveSpecificationProperty
- class CfnGlobalTable.TimeToLiveSpecificationProperty(*, enabled, attribute_name=None)
Bases:
object
Represents the settings used to enable or disable Time to Live (TTL) for the specified table.
All replicas will have the same time to live configuration.
- Parameters:
enabled (
Union
[bool
,IResolvable
]) – Indicates whether TTL is to be enabled (true) or disabled (false) on the table.attribute_name (
Optional
[str
]) – The name of the attribute used to store the expiration time for items in the table. Currently, you cannot directly change the attribute name used to evaluate time to live. In order to do so, you must first disable time to live, and then re-enable it with the new attribute name. It can take up to one hour for changes to time to live to take effect. If you attempt to modify time to live within that time window, your stack operation might be delayed.
- See:
- 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 time_to_live_specification_property = dynamodb.CfnGlobalTable.TimeToLiveSpecificationProperty( enabled=False, # the properties below are optional attribute_name="attributeName" )
Attributes
- attribute_name
The name of the attribute used to store the expiration time for items in the table.
Currently, you cannot directly change the attribute name used to evaluate time to live. In order to do so, you must first disable time to live, and then re-enable it with the new attribute name. It can take up to one hour for changes to time to live to take effect. If you attempt to modify time to live within that time window, your stack operation might be delayed.
- enabled
Indicates whether TTL is to be enabled (true) or disabled (false) on the table.
WriteOnDemandThroughputSettingsProperty
- class CfnGlobalTable.WriteOnDemandThroughputSettingsProperty(*, max_write_request_units=None)
Bases:
object
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
.- Parameters:
max_write_request_units (
Union
[int
,float
,None
]) – Maximum number of write request settings for the specified replica of a global table.- See:
- 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 write_on_demand_throughput_settings_property = dynamodb.CfnGlobalTable.WriteOnDemandThroughputSettingsProperty( max_write_request_units=123 )
Attributes
- max_write_request_units
Maximum number of write request settings for the specified replica of a global table.
WriteProvisionedThroughputSettingsProperty
- class CfnGlobalTable.WriteProvisionedThroughputSettingsProperty(*, write_capacity_auto_scaling_settings=None)
Bases:
object
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
.- Parameters:
write_capacity_auto_scaling_settings (
Union
[IResolvable
,CapacityAutoScalingSettingsProperty
,Dict
[str
,Any
],None
]) – Specifies auto scaling settings for the replica table or global secondary index.- See:
- 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 write_provisioned_throughput_settings_property = 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
- write_capacity_auto_scaling_settings
Specifies auto scaling settings for the replica table or global secondary index.