@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:42.382Z") @Stability(value=Stable) public interface CustomStateProps extends software.amazon.jsii.JsiiSerializable
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();
Chain chain = Chain.start(custom).next(finalStatus);
StateMachine sm = StateMachine.Builder.create(this, "StateMachine")
.definition(chain)
.timeout(Duration.seconds(30))
.build();
// don't forget permissions. You need to assign them
table.grantWriteData(sm);
| Modifier and Type | Interface and Description |
|---|---|
static class |
CustomStateProps.Builder
A builder for
CustomStateProps |
static class |
CustomStateProps.Jsii$Proxy
An implementation for
CustomStateProps |
| Modifier and Type | Method and Description |
|---|---|
static CustomStateProps.Builder |
builder() |
Map<String,Object> |
getStateJson()
Amazon States Language (JSON-based) definition of the state.
|
@Stability(value=Stable) @NotNull Map<String,Object> getStateJson()
@Stability(value=Stable) static CustomStateProps.Builder builder()
CustomStateProps.Builder of CustomStatePropsCopyright © 2022. All rights reserved.