Class StateMachine
Define a StepFunctions State Machine.
Inherited Members
Namespace: Amazon.CDK.AWS.StepFunctions
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class StateMachine : Resource, IStateMachine, IResource, IGrantable
Syntax (vb)
Public Class StateMachine
Inherits Resource
Implements IStateMachine, IResource, IGrantable
Remarks
ExampleMetadata: infused
Examples
using Amazon.CDK.AWS.StepFunctions;
var pipeline = new Pipeline(this, "MyPipeline");
var inputArtifact = new Artifact();
var startState = new Pass(this, "StartState");
var simpleStateMachine = new StateMachine(this, "SimpleStateMachine", new StateMachineProps {
Definition = startState
});
var stepFunctionAction = new StepFunctionInvokeAction(new StepFunctionsInvokeActionProps {
ActionName = "Invoke",
StateMachine = simpleStateMachine,
StateMachineInput = StateMachineInput.FilePath(inputArtifact.AtPath("assets/input.json"))
});
pipeline.AddStage(new StageOptions {
StageName = "StepFunctions",
Actions = new [] { stepFunctionAction }
});
Synopsis
Constructors
StateMachine(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
StateMachine(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
StateMachine(Construct, String, IStateMachineProps) |
Properties
GrantPrincipal | The principal this state machine is running as. |
Role | Execution role of this state machine. |
StateMachineArn | The ARN of the state machine. |
StateMachineName | The name of the state machine. |
StateMachineRevisionId | Identifier for the state machine revision, which is an immutable, read-only snapshot of a state machine’s definition and configuration. |
StateMachineType | Type of the state machine. |
Methods
AddToRolePolicy(PolicyStatement) | Add the given statement to the role's policy. |
FromStateMachineArn(Construct, String, String) | Import a state machine. |
FromStateMachineName(Construct, String, String) | Import a state machine via resource name. |
Grant(IGrantable, String[]) | Grant the given identity custom permissions. |
GrantExecution(IGrantable, String[]) | Grant the given identity permissions on all executions of the state machine. |
GrantRead(IGrantable) | Grant the given identity permissions to read results from state machine. |
GrantStartExecution(IGrantable) | Grant the given identity permissions to start an execution of this state machine. |
GrantStartSyncExecution(IGrantable) | Grant the given identity permissions to start a synchronous execution of this state machine. |
GrantTaskResponse(IGrantable) | Grant the given identity task response permissions on a state machine. |
Metric(String, IMetricOptions) | Return the given named metric for this State Machine's executions. |
MetricAborted(IMetricOptions) | Metric for the number of executions that were aborted. |
MetricFailed(IMetricOptions) | Metric for the number of executions that failed. |
MetricStarted(IMetricOptions) | Metric for the number of executions that were started. |
MetricSucceeded(IMetricOptions) | Metric for the number of executions that succeeded. |
MetricThrottled(IMetricOptions) | Metric for the number of executions that were throttled. |
MetricTime(IMetricOptions) | Metric for the interval, in milliseconds, between the time the execution starts and the time it closes. |
MetricTimedOut(IMetricOptions) | Metric for the number of executions that timed out. |
Constructors
StateMachine(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected StateMachine(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
StateMachine(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected StateMachine(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
StateMachine(Construct, String, IStateMachineProps)
public StateMachine(Construct scope, string id, IStateMachineProps props)
Parameters
- scope Constructs.Construct
- id System.String
- props IStateMachineProps
Properties
GrantPrincipal
The principal this state machine is running as.
public virtual IPrincipal GrantPrincipal { get; }
Property Value
Role
StateMachineArn
The ARN of the state machine.
public virtual string StateMachineArn { get; }
Property Value
System.String
StateMachineName
The name of the state machine.
public virtual string StateMachineName { get; }
Property Value
System.String
Remarks
Attribute: true
StateMachineRevisionId
Identifier for the state machine revision, which is an immutable, read-only snapshot of a state machine’s definition and configuration.
public virtual string StateMachineRevisionId { get; }
Property Value
System.String
Remarks
Attribute: true
StateMachineType
Type of the state machine.
public virtual StateMachineType StateMachineType { get; }
Property Value
Remarks
Attribute: true
Methods
AddToRolePolicy(PolicyStatement)
Add the given statement to the role's policy.
public virtual void AddToRolePolicy(PolicyStatement statement)
Parameters
- statement PolicyStatement
FromStateMachineArn(Construct, String, String)
Import a state machine.
public static IStateMachine FromStateMachineArn(Construct scope, string id, string stateMachineArn)
Parameters
- scope Constructs.Construct
- id System.String
- stateMachineArn System.String
Returns
FromStateMachineName(Construct, String, String)
Import a state machine via resource name.
public static IStateMachine FromStateMachineName(Construct scope, string id, string stateMachineName)
Parameters
- scope Constructs.Construct
- id System.String
- stateMachineName System.String
Returns
Grant(IGrantable, String[])
Grant the given identity custom permissions.
public virtual Grant Grant(IGrantable identity, params string[] actions)
Parameters
- identity IGrantable
- actions System.String[]
Returns
GrantExecution(IGrantable, String[])
Grant the given identity permissions on all executions of the state machine.
public virtual Grant GrantExecution(IGrantable identity, params string[] actions)
Parameters
- identity IGrantable
- actions System.String[]
Returns
GrantRead(IGrantable)
Grant the given identity permissions to read results from state machine.
public virtual Grant GrantRead(IGrantable identity)
Parameters
- identity IGrantable
Returns
GrantStartExecution(IGrantable)
Grant the given identity permissions to start an execution of this state machine.
public virtual Grant GrantStartExecution(IGrantable identity)
Parameters
- identity IGrantable
Returns
GrantStartSyncExecution(IGrantable)
Grant the given identity permissions to start a synchronous execution of this state machine.
public virtual Grant GrantStartSyncExecution(IGrantable identity)
Parameters
- identity IGrantable
Returns
GrantTaskResponse(IGrantable)
Grant the given identity task response permissions on a state machine.
public virtual Grant GrantTaskResponse(IGrantable identity)
Parameters
- identity IGrantable
Returns
Metric(String, IMetricOptions)
Return the given named metric for this State Machine's executions.
public virtual Metric Metric(string metricName, IMetricOptions props = null)
Parameters
- metricName System.String
- props IMetricOptions
Returns
Remarks
Default: - sum over 5 minutes
MetricAborted(IMetricOptions)
Metric for the number of executions that were aborted.
public virtual Metric MetricAborted(IMetricOptions props = null)
Parameters
- props IMetricOptions
Returns
Remarks
Default: - sum over 5 minutes
MetricFailed(IMetricOptions)
Metric for the number of executions that failed.
public virtual Metric MetricFailed(IMetricOptions props = null)
Parameters
- props IMetricOptions
Returns
Remarks
Default: - sum over 5 minutes
MetricStarted(IMetricOptions)
Metric for the number of executions that were started.
public virtual Metric MetricStarted(IMetricOptions props = null)
Parameters
- props IMetricOptions
Returns
Remarks
Default: - sum over 5 minutes
MetricSucceeded(IMetricOptions)
Metric for the number of executions that succeeded.
public virtual Metric MetricSucceeded(IMetricOptions props = null)
Parameters
- props IMetricOptions
Returns
Remarks
Default: - sum over 5 minutes
MetricThrottled(IMetricOptions)
Metric for the number of executions that were throttled.
public virtual Metric MetricThrottled(IMetricOptions props = null)
Parameters
- props IMetricOptions
Returns
Remarks
Default: - sum over 5 minutes
MetricTime(IMetricOptions)
Metric for the interval, in milliseconds, between the time the execution starts and the time it closes.
public virtual Metric MetricTime(IMetricOptions props = null)
Parameters
- props IMetricOptions
Returns
Remarks
Default: - average over 5 minutes
MetricTimedOut(IMetricOptions)
Metric for the number of executions that timed out.
public virtual Metric MetricTimedOut(IMetricOptions props = null)
Parameters
- props IMetricOptions
Returns
Remarks
Default: - sum over 5 minutes