Class StateMachine
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.core.Construct
software.amazon.awscdk.core.Resource
software.amazon.awscdk.services.stepfunctions.StateMachine
- All Implemented Interfaces:
IConstruct
,IDependable
,IResource
,IGrantable
,IStateMachine
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)",
date="2023-06-19T16:30:39.933Z")
@Stability(Stable)
public class StateMachine
extends Resource
implements IStateMachine
Define a StepFunctions State Machine.
Example:
import software.amazon.awscdk.services.stepfunctions.*; Pipeline pipeline = new Pipeline(this, "MyPipeline"); Artifact inputArtifact = new Artifact(); Pass startState = new Pass(this, "StartState"); StateMachine simpleStateMachine = StateMachine.Builder.create(this, "SimpleStateMachine") .definition(startState) .build(); StepFunctionInvokeAction stepFunctionAction = StepFunctionInvokeAction.Builder.create() .actionName("Invoke") .stateMachine(simpleStateMachine) .stateMachineInput(StateMachineInput.filePath(inputArtifact.atPath("assets/input.json"))) .build(); pipeline.addStage(StageOptions.builder() .stageName("StepFunctions") .actions(List.of(stepFunctionAction)) .build());
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IResource
IResource.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.stepfunctions.IStateMachine
IStateMachine.Jsii$Default, IStateMachine.Jsii$Proxy
-
Constructor Summary
ModifierConstructorDescriptionprotected
StateMachine
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
StateMachine
(software.amazon.jsii.JsiiObjectRef objRef) StateMachine
(software.constructs.Construct scope, String id, StateMachineProps props) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addToRolePolicy
(PolicyStatement statement) Add the given statement to the role's policy.static IStateMachine
fromStateMachineArn
(software.constructs.Construct scope, String id, String stateMachineArn) Import a state machine.The principal this state machine is running as.getRole()
Execution role of this state machine.The ARN of the state machine.The name of the state machine.Type of the state machine.grant
(IGrantable identity, @NotNull String... actions) Grant the given identity custom permissions.grantExecution
(IGrantable identity, @NotNull String... actions) Grant the given identity permissions on all executions of the state machine.grantRead
(IGrantable identity) Grant the given identity permissions to read results from state machine.grantStartExecution
(IGrantable identity) Grant the given identity permissions to start an execution of this state machine.grantStartSyncExecution
(IGrantable identity) Grant the given identity permissions to start a synchronous execution of this state machine.grantTaskResponse
(IGrantable identity) Grant the given identity task response permissions on a state machine.Return the given named metric for this State Machine's executions.metric
(String metricName, MetricOptions props) Return the given named metric for this State Machine's executions.Metric for the number of executions that were aborted.metricAborted
(MetricOptions props) Metric for the number of executions that were aborted.Metric for the number of executions that failed.metricFailed
(MetricOptions props) Metric for the number of executions that failed.Metric for the number of executions that were started.metricStarted
(MetricOptions props) Metric for the number of executions that were started.Metric for the number of executions that succeeded.metricSucceeded
(MetricOptions props) Metric for the number of executions that succeeded.Metric for the number of executions that were throttled.metricThrottled
(MetricOptions props) Metric for the number of executions that were throttled.Metric for the interval, in milliseconds, between the time the execution starts and the time it closes.metricTime
(MetricOptions props) Metric for the interval, in milliseconds, between the time the execution starts and the time it closes.Metric for the number of executions that timed out.metricTimedOut
(MetricOptions props) Metric for the number of executions that timed out.Methods inherited from class software.amazon.awscdk.core.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isResource
Methods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
Methods inherited from class software.constructs.Construct
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.amazon.awscdk.core.IConstruct
getNode
Methods inherited from interface software.amazon.awscdk.core.IResource
applyRemovalPolicy, getEnv, getStack
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
StateMachine
protected StateMachine(software.amazon.jsii.JsiiObjectRef objRef) -
StateMachine
protected StateMachine(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
StateMachine
@Stability(Stable) public StateMachine(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull StateMachineProps props) - Parameters:
scope
- This parameter is required.id
- This parameter is required.props
- This parameter is required.
-
-
Method Details
-
fromStateMachineArn
@Stability(Stable) @NotNull public static IStateMachine fromStateMachineArn(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String stateMachineArn) Import a state machine.- Parameters:
scope
- This parameter is required.id
- This parameter is required.stateMachineArn
- This parameter is required.
-
addToRolePolicy
Add the given statement to the role's policy.- Parameters:
statement
- This parameter is required.
-
grant
@Stability(Stable) @NotNull public Grant grant(@NotNull IGrantable identity, @NotNull @NotNull String... actions) Grant the given identity custom permissions.- Specified by:
grant
in interfaceIStateMachine
- Parameters:
identity
- This parameter is required.actions
- This parameter is required.
-
grantExecution
@Stability(Stable) @NotNull public Grant grantExecution(@NotNull IGrantable identity, @NotNull @NotNull String... actions) Grant the given identity permissions on all executions of the state machine.- Specified by:
grantExecution
in interfaceIStateMachine
- Parameters:
identity
- This parameter is required.actions
- This parameter is required.
-
grantRead
Grant the given identity permissions to read results from state machine.- Specified by:
grantRead
in interfaceIStateMachine
- Parameters:
identity
- This parameter is required.
-
grantStartExecution
Grant the given identity permissions to start an execution of this state machine.- Specified by:
grantStartExecution
in interfaceIStateMachine
- Parameters:
identity
- This parameter is required.
-
grantStartSyncExecution
Grant the given identity permissions to start a synchronous execution of this state machine.- Specified by:
grantStartSyncExecution
in interfaceIStateMachine
- Parameters:
identity
- This parameter is required.
-
grantTaskResponse
Grant the given identity task response permissions on a state machine.- Specified by:
grantTaskResponse
in interfaceIStateMachine
- Parameters:
identity
- This parameter is required.
-
metric
@Stability(Stable) @NotNull public Metric metric(@NotNull String metricName, @Nullable MetricOptions props) Return the given named metric for this State Machine's executions.Default: - sum over 5 minutes
- Specified by:
metric
in interfaceIStateMachine
- Parameters:
metricName
- This parameter is required.props
-
-
metric
Return the given named metric for this State Machine's executions.Default: - sum over 5 minutes
- Specified by:
metric
in interfaceIStateMachine
- Parameters:
metricName
- This parameter is required.
-
metricAborted
Metric for the number of executions that were aborted.Default: - sum over 5 minutes
- Specified by:
metricAborted
in interfaceIStateMachine
- Parameters:
props
-
-
metricAborted
Metric for the number of executions that were aborted.Default: - sum over 5 minutes
- Specified by:
metricAborted
in interfaceIStateMachine
-
metricFailed
Metric for the number of executions that failed.Default: - sum over 5 minutes
- Specified by:
metricFailed
in interfaceIStateMachine
- Parameters:
props
-
-
metricFailed
Metric for the number of executions that failed.Default: - sum over 5 minutes
- Specified by:
metricFailed
in interfaceIStateMachine
-
metricStarted
Metric for the number of executions that were started.Default: - sum over 5 minutes
- Specified by:
metricStarted
in interfaceIStateMachine
- Parameters:
props
-
-
metricStarted
Metric for the number of executions that were started.Default: - sum over 5 minutes
- Specified by:
metricStarted
in interfaceIStateMachine
-
metricSucceeded
Metric for the number of executions that succeeded.Default: - sum over 5 minutes
- Specified by:
metricSucceeded
in interfaceIStateMachine
- Parameters:
props
-
-
metricSucceeded
Metric for the number of executions that succeeded.Default: - sum over 5 minutes
- Specified by:
metricSucceeded
in interfaceIStateMachine
-
metricThrottled
Metric for the number of executions that were throttled.Default: - sum over 5 minutes
- Specified by:
metricThrottled
in interfaceIStateMachine
- Parameters:
props
-
-
metricThrottled
Metric for the number of executions that were throttled.Default: - sum over 5 minutes
- Specified by:
metricThrottled
in interfaceIStateMachine
-
metricTime
Metric for the interval, in milliseconds, between the time the execution starts and the time it closes.Default: - average over 5 minutes
- Specified by:
metricTime
in interfaceIStateMachine
- Parameters:
props
-
-
metricTime
Metric for the interval, in milliseconds, between the time the execution starts and the time it closes.Default: - average over 5 minutes
- Specified by:
metricTime
in interfaceIStateMachine
-
metricTimedOut
Metric for the number of executions that timed out.Default: - sum over 5 minutes
- Specified by:
metricTimedOut
in interfaceIStateMachine
- Parameters:
props
-
-
metricTimedOut
Metric for the number of executions that timed out.Default: - sum over 5 minutes
- Specified by:
metricTimedOut
in interfaceIStateMachine
-
getGrantPrincipal
The principal this state machine is running as.- Specified by:
getGrantPrincipal
in interfaceIGrantable
-
getRole
Execution role of this state machine. -
getStateMachineArn
The ARN of the state machine.- Specified by:
getStateMachineArn
in interfaceIStateMachine
-
getStateMachineName
The name of the state machine. -
getStateMachineType
Type of the state machine.
-