Class Table
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.Resource
software.amazon.awscdk.services.dynamodb.TableBase
software.amazon.awscdk.services.dynamodb.Table
- All Implemented Interfaces:
IResource
,ITable
,IResourceWithPolicy
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.106.0 (build e852934)",
date="2025-02-06T22:15:52.762Z")
@Stability(Stable)
public class Table
extends TableBase
Provides a DynamoDB table.
Example:
import software.amazon.awscdk.services.lambda.eventsources.*; import software.amazon.awscdk.services.dynamodb.*; import software.amazon.awscdk.services.kms.Key; Function fn; Table table = Table.Builder.create(this, "Table") .partitionKey(Attribute.builder() .name("id") .type(AttributeType.STRING) .build()) .stream(StreamViewType.NEW_IMAGE) .build(); // Your self managed KMS key IKey myKey = Key.fromKeyArn(this, "SourceBucketEncryptionKey", "arn:aws:kms:us-east-1:123456789012:key/<key-id>"); fn.addEventSource(DynamoEventSource.Builder.create(table) .startingPosition(StartingPosition.LATEST) .filters(List.of(FilterCriteria.filter(Map.of("eventName", FilterRule.isEqual("INSERT"))))) .filterEncryption(myKey) .build());
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.IResource
IResource.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.iam.IResourceWithPolicy
IResourceWithPolicy.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.dynamodb.ITable
ITable.Jsii$Default
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Table
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
Table
(software.amazon.jsii.JsiiObjectRef objRef) Table
(software.constructs.Construct scope, String id, TableProps props) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a global secondary index of table.void
Add a local secondary index of table.autoScaleGlobalSecondaryIndexReadCapacity
(String indexName, EnableScalingProps props) Enable read capacity scaling for the given GSI.autoScaleGlobalSecondaryIndexWriteCapacity
(String indexName, EnableScalingProps props) Enable write capacity scaling for the given GSI.Enable read capacity scaling for this table.Enable write capacity scaling for this table.static ITable
fromTableArn
(software.constructs.Construct scope, String id, String tableArn) Creates a Table construct that represents an external table via table arn.static ITable
fromTableAttributes
(software.constructs.Construct scope, String id, TableAttributes attrs) Creates a Table construct that represents an external table.static ITable
fromTableName
(software.constructs.Construct scope, String id, String tableName) Creates a Table construct that represents an external table via table name.KMS encryption key, if this table uses a customer-managed encryption key.protected Boolean
Whether this table has indexes.Resource policy to assign to DynamoDB Table.Arn of the dynamodb table.Table name of the dynamodb table.ARN of the table's stream, if there is one.schema()
Get schema attributes of table or index.Get schema attributes of table or index.void
setResourcePolicy
(PolicyDocument value) Resource policy to assign to DynamoDB Table.Methods inherited from class software.amazon.awscdk.services.dynamodb.TableBase
addToResourcePolicy, getRegionalArns, 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, metricUserErrors
Methods inherited from class software.amazon.awscdk.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isOwnedResource, isResource
Methods inherited from class software.constructs.Construct
getNode, isConstruct, toString
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.constructs.IConstruct
getNode
Methods inherited from interface software.amazon.awscdk.IResource
applyRemovalPolicy, getEnv, getStack
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
Table
protected Table(software.amazon.jsii.JsiiObjectRef objRef) -
Table
protected Table(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
Table
@Stability(Stable) public Table(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull TableProps 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 ITable 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 ITable fromTableAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull TableAttributes 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
- ATableAttributes
object. This parameter is required.
-
fromTableName
@Stability(Stable) @NotNull public static ITable 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 of table.- Parameters:
props
- the property of global secondary index. This parameter is required.
-
addLocalSecondaryIndex
Add a local secondary index of table.- Parameters:
props
- the property of local secondary index. This parameter is required.
-
autoScaleGlobalSecondaryIndexReadCapacity
@Stability(Stable) @NotNull public IScalableTableAttribute autoScaleGlobalSecondaryIndexReadCapacity(@NotNull String indexName, @NotNull EnableScalingProps props) Enable read capacity scaling for the given GSI.- Parameters:
indexName
- This parameter is required.props
- This parameter is required.- Returns:
- An object to configure additional AutoScaling settings for this attribute
-
autoScaleGlobalSecondaryIndexWriteCapacity
@Stability(Stable) @NotNull public IScalableTableAttribute autoScaleGlobalSecondaryIndexWriteCapacity(@NotNull String indexName, @NotNull EnableScalingProps props) Enable write capacity scaling for the given GSI.- Parameters:
indexName
- This parameter is required.props
- This parameter is required.- Returns:
- An object to configure additional AutoScaling settings for this attribute
-
autoScaleReadCapacity
@Stability(Stable) @NotNull public IScalableTableAttribute autoScaleReadCapacity(@NotNull EnableScalingProps props) Enable read capacity scaling for this table.- Parameters:
props
- This parameter is required.- Returns:
- An object to configure additional AutoScaling settings
-
autoScaleWriteCapacity
@Stability(Stable) @NotNull public IScalableTableAttribute autoScaleWriteCapacity(@NotNull EnableScalingProps props) Enable write capacity scaling for this table.- Parameters:
props
- This parameter is required.- Returns:
- An object to configure additional AutoScaling settings for this attribute
-
schema
Get schema attributes of table or index.- Parameters:
indexName
-- Returns:
- Schema of table or index.
-
schema
Get schema attributes of table or index.- Returns:
- Schema of table or index.
-
getHasIndex
Whether this table has indexes.- Specified by:
getHasIndex
in classTableBase
-
getTableArn
Arn of the dynamodb table.- Specified by:
getTableArn
in interfaceITable
- Specified by:
getTableArn
in classTableBase
-
getTableName
Table name of the dynamodb table.- Specified by:
getTableName
in interfaceITable
- Specified by:
getTableName
in classTableBase
-
getEncryptionKey
KMS encryption key, if this table uses a customer-managed encryption key.- Specified by:
getEncryptionKey
in interfaceITable
- Specified by:
getEncryptionKey
in classTableBase
-
getTableStreamArn
ARN of the table's stream, if there is one.- Specified by:
getTableStreamArn
in interfaceITable
- Specified by:
getTableStreamArn
in classTableBase
-
getResourcePolicy
Resource policy to assign to DynamoDB Table.Default: - No resource policy statements are added to the created table.
- Specified by:
getResourcePolicy
in classTableBase
- See Also:
-
setResourcePolicy
Resource policy to assign to DynamoDB Table.Default: - No resource policy statements are added to the created table.
- Specified by:
setResourcePolicy
in classTableBase
- See Also:
-