Class TableV2
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.TableV2
- All Implemented Interfaces:
IResource,ITable,ITableV2,IResourceWithPolicy,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.116.0 (build 0eddcff)",
date="2025-10-24T13:34:35.314Z")
@Stability(Stable)
public class TableV2
extends TableBaseV2
A DynamoDB Table.
Example:
import software.amazon.awscdk.*;
App app = new App();
Stack stack = Stack.Builder.create(app, "Stack").env(Environment.builder().region("us-west-2").build()).build();
TableV2 mrscTable = TableV2.Builder.create(stack, "MRSCTable")
.partitionKey(Attribute.builder().name("pk").type(AttributeType.STRING).build())
.multiRegionConsistency(MultiRegionConsistency.STRONG)
.replicas(List.of(ReplicaTableProps.builder().region("us-east-1").build()))
.witnessRegion("us-east-2")
.build();
-
Nested Class Summary
Nested ClassesNested 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
ConstructorsModifierConstructorDescriptionprotectedTableV2(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedTableV2(software.amazon.jsii.JsiiObjectRef objRef) TableV2(software.constructs.Construct scope, String id, TablePropsV2 props) -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a global secondary index to the table.voidAdd a local secondary index to the table.voidaddReplica(ReplicaTableProps props) Add a replica table.static ITableV2fromTableArn(software.constructs.Construct scope, String id, String tableArn) Creates a Table construct that represents an external table via table ARN.static ITableV2fromTableAttributes(software.constructs.Construct scope, String id, TableAttributesV2 attrs) Creates a Table construct that represents an external table.static ITableV2fromTableName(software.constructs.Construct scope, String id, String tableName) Creates a Table construct that represents an external table via table name.The KMS encryption key for the 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.protected TagManagergetTags()Retrieve a replica table.voidsetResourcePolicy(PolicyDocument value) The resource policy for the table.Methods inherited from class software.amazon.awscdk.services.dynamodb.TableBaseV2
addToResourcePolicy, grant, grantFullAccess, 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, isResourceMethods 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
getNodeMethods inherited from interface software.amazon.awscdk.IResource
applyRemovalPolicy, getEnv, getStackMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
PROPERTY_INJECTION_ID
Uniquely identifies this class.
-
-
Constructor Details
-
TableV2
protected TableV2(software.amazon.jsii.JsiiObjectRef objRef) -
TableV2
protected TableV2(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
TableV2
@Stability(Stable) public TableV2(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull TablePropsV2 props) - Parameters:
scope- This parameter is required.id- This parameter is required.props- This parameter is required.
-
-
Method Details
-
fromTableArn
@Stability(Stable) @NotNull public static ITableV2 fromTableArn(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String tableArn) Creates a Table construct that represents an external table via table ARN.- Parameters:
scope- the parent creating construct (usuallythis). This parameter is required.id- the construct's name. This parameter is required.tableArn- the table's ARN. This parameter is required.
-
fromTableAttributes
@Stability(Stable) @NotNull public static ITableV2 fromTableAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull TableAttributesV2 attrs) Creates a Table construct that represents an external table.- Parameters:
scope- the parent creating construct (usuallythis). This parameter is required.id- the construct's name. This parameter is required.attrs- attributes of the table. This parameter is required.
-
fromTableName
@Stability(Stable) @NotNull public static ITableV2 fromTableName(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String tableName) Creates a Table construct that represents an external table via table name.- Parameters:
scope- the parent creating construct (usuallythis). This parameter is required.id- the construct's name. This parameter is required.tableName- the table's name. This parameter is required.
-
addGlobalSecondaryIndex
Add a global secondary index to the table.Note: Global secondary indexes will be inherited by all replica tables.
- Parameters:
props- the properties of the global secondary index. This parameter is required.
-
addLocalSecondaryIndex
Add a local secondary index to the table.Note: Local secondary indexes will be inherited by all replica tables.
- Parameters:
props- the properties of the local secondary index. This parameter is required.
-
addReplica
Add a replica table.Note: Adding a replica table will allow you to use your table as a global table.
- Parameters:
props- the properties of the replica table to add. This parameter is required.
-
replica
Retrieve a replica table.Note: Replica tables are not supported in a region agnostic stack.
- Parameters:
region- the region of the replica table. This parameter is required.
-
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
-
getTags
-
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
-