Class TableV2MultiAccountReplica
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.Resource
software.amazon.awscdk.services.dynamodb.TableBaseV2
software.amazon.awscdk.services.dynamodb.TableV2MultiAccountReplica
- All Implemented Interfaces:
ITableRef,IEnvironmentAware,IResource,ITable,ITableV2,IResourceWithPolicy,IResourceWithPolicyV2,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.127.0 (build 2117ad5)",
date="2026-03-02T12:05:07.097Z")
@Stability(Stable)
public class TableV2MultiAccountReplica
extends TableBaseV2
A nulti-account replica of a DynamoDB table.
This construct represents a replica table in a different AWS account from the source table. It inherits the schema (partition key, sort key, and indexes) from the source table.
Permissions on the replica side are automatically configured. You must manually add
permissions to the source table using sourceTable.grants.nultiAccountReplicationTo(replica.tableArn).
Example:
import software.amazon.awscdk.*;
App app = new App();
// Source table in Account A
Stack sourceStack = Stack.Builder.create(app, "SourceStack")
.env(Environment.builder().region("us-east-2").account("111111111111").build())
.build();
TableV2 sourceTable = TableV2.Builder.create(sourceStack, "SourceTable")
.tableName("MyMultiAccountTable")
.partitionKey(Attribute.builder().name("pk").type(AttributeType.STRING).build())
.globalTableSettingsReplicationMode(GlobalTableSettingsReplicationMode.ALL)
.build();
// Replica stack in Account B
Stack replicaStack = Stack.Builder.create(app, "ReplicaStack")
.env(Environment.builder().region("us-east-1").account("222222222222").build())
.build();
// Create replica - permissions are automatically configured
TableV2MultiAccountReplica replica = TableV2MultiAccountReplica.Builder.create(replicaStack, "ReplicaTable")
.tableName("MyMultiAccountTable")
.replicaSourceTable(sourceTable)
.globalTableSettingsReplicationMode(GlobalTableSettingsReplicationMode.ALL)
.build();
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA fluent builder forTableV2MultiAccountReplica.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.IResource
IResource.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.services.iam.IResourceWithPolicy
IResourceWithPolicy.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.services.dynamodb.ITableV2
ITableV2.Jsii$Default -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedTableV2MultiAccountReplica(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedTableV2MultiAccountReplica(software.amazon.jsii.JsiiObjectRef objRef) TableV2MultiAccountReplica(software.constructs.Construct scope, String id) TableV2MultiAccountReplica(software.constructs.Construct scope, String id, TableV2MultiAccountReplicaProps props) -
Method Summary
Modifier and TypeMethodDescriptionaddToResourcePolicy(PolicyStatement statement) Adds a statement to the resource policy associated with this table.The KMS encryption key for the table.Grants for this table.protected Booleanprotected StringThe resource policy for the table.The ARN of the table.The ID of the table.The name of the table.The stream ARN of the table.voidsetResourcePolicy(PolicyDocument value) The resource policy for the table.Methods inherited from class software.amazon.awscdk.services.dynamodb.TableBaseV2
getTableRef, grant, grantFullAccess, grantOnKey, grantReadData, grantReadWriteData, grantStream, grantStreamRead, grantTableListStreams, grantWriteData, metric, metric, metricConditionalCheckFailedRequests, metricConditionalCheckFailedRequests, metricConsumedReadCapacityUnits, metricConsumedReadCapacityUnits, metricConsumedWriteCapacityUnits, metricConsumedWriteCapacityUnits, metricSuccessfulRequestLatency, metricSuccessfulRequestLatency, metricSystemErrors, metricSystemErrors, metricSystemErrorsForOperations, metricSystemErrorsForOperations, metricThrottledRequests, metricThrottledRequests, metricThrottledRequestsForOperation, metricThrottledRequestsForOperation, metricThrottledRequestsForOperations, metricThrottledRequestsForOperations, metricUserErrors, metricUserErrorsMethods inherited from class software.amazon.awscdk.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isOwnedResource, isResource, withMethods inherited from class software.constructs.Construct
getNode, isConstruct, toStringMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNode, withMethods inherited from interface software.amazon.awscdk.interfaces.IEnvironmentAware
getEnvMethods inherited from interface software.amazon.awscdk.IResource
applyRemovalPolicy, getStackMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
PROPERTY_INJECTION_ID
Uniquely identifies this class.
-
-
Constructor Details
-
TableV2MultiAccountReplica
protected TableV2MultiAccountReplica(software.amazon.jsii.JsiiObjectRef objRef) -
TableV2MultiAccountReplica
protected TableV2MultiAccountReplica(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
TableV2MultiAccountReplica
@Stability(Stable) public TableV2MultiAccountReplica(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable TableV2MultiAccountReplicaProps props) - Parameters:
scope- This parameter is required.id- This parameter is required.props-
-
TableV2MultiAccountReplica
@Stability(Stable) public TableV2MultiAccountReplica(@NotNull software.constructs.Construct scope, @NotNull String id) - Parameters:
scope- This parameter is required.id- This parameter is required.
-
-
Method Details
-
addToResourcePolicy
@Stability(Stable) @NotNull public AddToResourcePolicyResult addToResourcePolicy(@NotNull PolicyStatement statement) Adds a statement to the resource policy associated with this table.- Specified by:
addToResourcePolicyin interfaceIResourceWithPolicyV2- Specified by:
addToResourcePolicyin classTableBaseV2- Parameters:
statement- This parameter is required.
-
getGrants
Grants for this table.- Specified by:
getGrantsin interfaceITableV2- Specified by:
getGrantsin classTableBaseV2
-
getHasIndex
- Specified by:
getHasIndexin classTableBaseV2
-
getRegion
- Specified by:
getRegionin classTableBaseV2
-
getTableArn
The ARN of the table.- Specified by:
getTableArnin interfaceITable- Specified by:
getTableArnin classTableBaseV2
-
getTableName
The name of the table.- Specified by:
getTableNamein interfaceITable- Specified by:
getTableNamein classTableBaseV2
-
getEncryptionKey
The KMS encryption key for the table.- Specified by:
getEncryptionKeyin interfaceITable- Specified by:
getEncryptionKeyin classTableBaseV2
-
getTableId
The ID of the table.- Specified by:
getTableIdin interfaceITableV2- Specified by:
getTableIdin classTableBaseV2
-
getTableStreamArn
The stream ARN of the table.- Specified by:
getTableStreamArnin interfaceITable- Specified by:
getTableStreamArnin classTableBaseV2
-
getResourcePolicy
The resource policy for the table.- Specified by:
getResourcePolicyin classTableBaseV2
-
setResourcePolicy
The resource policy for the table.- Specified by:
setResourcePolicyin classTableBaseV2
-