Interface TableProps
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable,SchemaOptions,TableOptions
- All Known Implementing Classes:
TableProps.Jsii$Proxy
@Generated(value="jsii-pacmak/1.93.0 (build 1706ca5)",
date="2024-01-03T18:29:24.898Z")
@Stability(Stable)
public interface TableProps
extends software.amazon.jsii.JsiiSerializable, TableOptions
Properties for a DynamoDB Table.
Example:
import software.amazon.awscdk.services.dynamodb.*;
// create a table
Table table = Table.Builder.create(this, "montable")
.partitionKey(Attribute.builder()
.name("id")
.type(AttributeType.STRING)
.build())
.build();
Pass finalStatus = new Pass(this, "final step");
// States language JSON to put an item into DynamoDB
// snippet generated from https://docs.aws.amazon.com/step-functions/latest/dg/tutorial-code-snippet.html#tutorial-code-snippet-1
Map<String, Object> stateJson = Map.of(
"Type", "Task",
"Resource", "arn:aws:states:::dynamodb:putItem",
"Parameters", Map.of(
"TableName", table.getTableName(),
"Item", Map.of(
"id", Map.of(
"S", "MyEntry"))),
"ResultPath", null);
// custom state which represents a task to insert data into DynamoDB
CustomState custom = CustomState.Builder.create(this, "my custom task")
.stateJson(stateJson)
.build();
// catch errors with addCatch
Pass errorHandler = new Pass(this, "handle failure");
custom.addCatch(errorHandler);
Chain chain = Chain.start(custom).next(finalStatus);
StateMachine sm = StateMachine.Builder.create(this, "StateMachine")
.definitionBody(DefinitionBody.fromChainable(chain))
.timeout(Duration.seconds(30))
.comment("a super cool state machine")
.build();
// don't forget permissions. You need to assign them
table.grantWriteData(sm);
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forTablePropsstatic final classAn implementation forTableProps -
Method Summary
Modifier and TypeMethodDescriptionstatic TableProps.Builderbuilder()default IStreamKinesis Data Stream to capture item-level changes for the table.default StringEnforces a particular physical table name.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJsonMethods inherited from interface software.amazon.awscdk.services.dynamodb.SchemaOptions
getPartitionKey, getSortKeyMethods inherited from interface software.amazon.awscdk.services.dynamodb.TableOptions
getBillingMode, getContributorInsightsEnabled, getDeletionProtection, getEncryption, getEncryptionKey, getPointInTimeRecovery, getReadCapacity, getRemovalPolicy, getReplicationRegions, getReplicationTimeout, getStream, getTableClass, getTimeToLiveAttribute, getWaitForReplicationToFinish, getWriteCapacity
-
Method Details
-
getKinesisStream
Kinesis Data Stream to capture item-level changes for the table.Default: - no Kinesis Data Stream
-
getTableName
Enforces a particular physical table name.Default:
-
builder
- Returns:
- a
TableProps.BuilderofTableProps
-