TableV2MultiAccountReplicaProps
- class aws_cdk.aws_dynamodb.TableV2MultiAccountReplicaProps(*, contributor_insights=None, contributor_insights_specification=None, deletion_protection=None, kinesis_stream=None, point_in_time_recovery=None, point_in_time_recovery_specification=None, resource_policy=None, table_class=None, tags=None, encryption=None, global_table_settings_replication_mode=None, grant_index_permissions=None, removal_policy=None, replica_source_table=None, table_name=None)
Bases:
TableOptionsV2Properties for creating a multi-account replica table.
Note: partitionKey, sortKey, and localSecondaryIndexes are not options because CloudFormation automatically inherits the key schema and LSIs from the source table via globalTableSourceArn.
- Parameters:
contributor_insights (
Optional[bool]) – (deprecated) Whether CloudWatch contributor insights is enabled. Default: falsecontributor_insights_specification (
Union[ContributorInsightsSpecification,Dict[str,Any],None]) – Whether CloudWatch contributor insights is enabled and what mode is selected. Default: - contributor insights is not enableddeletion_protection (
Optional[bool]) – Whether deletion protection is enabled. Default: falsekinesis_stream (
Optional[IStream]) – Kinesis Data Stream to capture item level changes. Default: - no Kinesis Data Streampoint_in_time_recovery (
Optional[bool]) – (deprecated) Whether point-in-time recovery is enabled. Default: false - point in time recovery is not enabled.point_in_time_recovery_specification (
Union[PointInTimeRecoverySpecification,Dict[str,Any],None]) – Whether point-in-time recovery is enabled and recoveryPeriodInDays is set. Default: - point in time recovery is not enabled.resource_policy (
Optional[PolicyDocument]) – Resource policy to assign to DynamoDB Table. Default: - No resource policy statements are added to the created table.table_class (
Optional[TableClass]) – The table class. Default: TableClass.STANDARDtags (
Optional[Sequence[Union[CfnTag,Dict[str,Any]]]]) – Tags to be applied to the primary table (default replica table). Default: - no tagsencryption (
Optional[TableEncryptionV2]) – The server-side encryption configuration for the replica table. Note: Each replica manages its own encryption independently. This is not synchronized across replicas. Default: TableEncryptionV2.dynamoOwnedKey()global_table_settings_replication_mode (
Optional[GlobalTableSettingsReplicationMode]) – Controls whether table settings are synchronized across replicas. When set to ALL, synchronizable settings (billing mode, throughput, TTL, streams view type, GSIs) are automatically replicated across all replicas. When set to NONE, each replica manages its own settings independently (billing mode must be PAY_PER_REQUEST). Note: Some settings are always synchronized (key schema, LSIs) regardless of this setting, and some are never synchronized (table class, SSE, deletion protection, PITR, tags, resource policy). Default: GlobalTableSettingsReplicationMode.ALLgrant_index_permissions (
Optional[bool]) – Whether or not to grant permissions for all indexes of the table. Note: If false, permissions will only be granted to indexes whenglobalIndexesis specified. Default: falseremoval_policy (
Optional[RemovalPolicy]) – The removal policy applied to the table. Default: RemovalPolicy.RETAINreplica_source_table (
Optional[ITableV2]) – The source table to replicate from. [disable-awslint:prefer-ref-interface] Default: - must be providedtable_name (
Optional[str]) – Enforces a particular physical table name. Default: - generated by CloudFormation
- ExampleMetadata:
infused
Example:
import aws_cdk as cdk app = cdk.App() # Source table in Account A source_stack = cdk.Stack(app, "SourceStack", env=cdk.Environment(region="us-east-2", account="111111111111") ) source_table = dynamodb.TableV2(source_stack, "SourceTable", table_name="MyMultiAccountTable", partition_key=dynamodb.Attribute(name="pk", type=dynamodb.AttributeType.STRING), global_table_settings_replication_mode=dynamodb.GlobalTableSettingsReplicationMode.ALL ) # Replica stack in Account B replica_stack = cdk.Stack(app, "ReplicaStack", env=cdk.Environment(region="us-east-1", account="222222222222") ) # Create replica - permissions are automatically configured replica = dynamodb.TableV2MultiAccountReplica(replica_stack, "ReplicaTable", table_name="MyMultiAccountTable", replica_source_table=source_table, global_table_settings_replication_mode=dynamodb.GlobalTableSettingsReplicationMode.ALL )
Attributes
- contributor_insights
(deprecated) Whether CloudWatch contributor insights is enabled.
- Default:
false
- Deprecated:
use
contributorInsightsSpecificationinstead- Stability:
deprecated
- contributor_insights_specification
Whether CloudWatch contributor insights is enabled and what mode is selected.
- Default:
contributor insights is not enabled
- deletion_protection
Whether deletion protection is enabled.
- Default:
false
- encryption
The server-side encryption configuration for the replica table.
Note: Each replica manages its own encryption independently. This is not synchronized across replicas.
- Default:
TableEncryptionV2.dynamoOwnedKey()
- global_table_settings_replication_mode
Controls whether table settings are synchronized across replicas.
When set to ALL, synchronizable settings (billing mode, throughput, TTL, streams view type, GSIs) are automatically replicated across all replicas. When set to NONE, each replica manages its own settings independently (billing mode must be PAY_PER_REQUEST).
Note: Some settings are always synchronized (key schema, LSIs) regardless of this setting, and some are never synchronized (table class, SSE, deletion protection, PITR, tags, resource policy).
- Default:
GlobalTableSettingsReplicationMode.ALL
- grant_index_permissions
Whether or not to grant permissions for all indexes of the table.
Note: If false, permissions will only be granted to indexes when
globalIndexesis specified.- Default:
false
- kinesis_stream
Kinesis Data Stream to capture item level changes.
- Default:
no Kinesis Data Stream
- point_in_time_recovery
(deprecated) Whether point-in-time recovery is enabled.
- Default:
false - point in time recovery is not enabled.
- Deprecated:
use
pointInTimeRecoverySpecificationinstead- Stability:
deprecated
- point_in_time_recovery_specification
Whether point-in-time recovery is enabled and recoveryPeriodInDays is set.
- Default:
point in time recovery is not enabled.
- removal_policy
The removal policy applied to the table.
- Default:
RemovalPolicy.RETAIN
- replica_source_table
The source table to replicate from.
[disable-awslint:prefer-ref-interface]
- Default:
must be provided
- resource_policy
Resource policy to assign to DynamoDB Table.
- Default:
No resource policy statements are added to the created table.
- See:
- table_class
The table class.
- Default:
TableClass.STANDARD
- table_name
Enforces a particular physical table name.
- Default:
generated by CloudFormation
- tags
Tags to be applied to the primary table (default replica table).
- Default:
no tags