interface IStateMachine
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.StepFunctions.IStateMachine |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsstepfunctions#IStateMachine |
Java | software.amazon.awscdk.services.stepfunctions.IStateMachine |
Python | aws_cdk.aws_stepfunctions.IStateMachine |
TypeScript (source) | aws-cdk-lib » aws_stepfunctions » IStateMachine |
Implemented by
State
Obtainable from
State
.fromStateMachineArn()
, State
.fromStateMachineName()
A State Machine.
Properties
Name | Type | Description |
---|---|---|
env | Resource | The environment this resource belongs to. |
grant | IPrincipal | The principal to grant permissions to. |
node | Node | The tree node. |
stack | Stack | The stack in which this resource is defined. |
state | string | The ARN of the state machine. |
env
Type:
Resource
The environment this resource belongs to.
For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.
grantPrincipal
Type:
IPrincipal
The principal to grant permissions to.
node
Type:
Node
The tree node.
stack
Type:
Stack
The stack in which this resource is defined.
stateMachineArn
Type:
string
The ARN of the state machine.
Methods
Name | Description |
---|---|
apply | Apply the given removal policy to this resource. |
grant(identity, ...actions) | Grant the given identity custom permissions. |
grant | Grant the given identity permissions for all executions of a state machine. |
grant | Grant the given identity read permissions for this state machine. |
grant | Grant the given identity permissions to start an execution of this state machine. |
grant | Grant the given identity permissions to start a synchronous execution of this state machine. |
grant | Grant the given identity read permissions for this state machine. |
metric(metricName, props?) | Return the given named metric for this State Machine's executions. |
metric | Metric for the number of executions that were aborted. |
metric | Metric for the number of executions that failed. |
metric | Metric for the number of executions that were started. |
metric | Metric for the number of executions that succeeded. |
metric | Metric for the number of executions that were throttled. |
metric | Metric for the interval, in milliseconds, between the time the execution starts and the time it closes. |
metric | Metric for the number of executions that timed out. |
RemovalPolicy(policy)
applypublic applyRemovalPolicy(policy: RemovalPolicy): void
Parameters
- policy
Removal
Policy
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.
The resource can be deleted (RemovalPolicy.DESTROY
), or left in your AWS
account for data recovery and cleanup later (RemovalPolicy.RETAIN
).
grant(identity, ...actions)
public grant(identity: IGrantable, ...actions: string[]): Grant
Parameters
- identity
IGrantable
— The principal. - actions
string
— The list of desired actions.
Returns
Grant the given identity custom permissions.
Execution(identity, ...actions)
grantpublic grantExecution(identity: IGrantable, ...actions: string[]): Grant
Parameters
- identity
IGrantable
— The principal. - actions
string
— The list of desired actions.
Returns
Grant the given identity permissions for all executions of a state machine.
Read(identity)
grantpublic grantRead(identity: IGrantable): Grant
Parameters
- identity
IGrantable
— The principal.
Returns
Grant the given identity read permissions for this state machine.
StartExecution(identity)
grantpublic grantStartExecution(identity: IGrantable): Grant
Parameters
- identity
IGrantable
— The principal.
Returns
Grant the given identity permissions to start an execution of this state machine.
StartSyncExecution(identity)
grantpublic grantStartSyncExecution(identity: IGrantable): Grant
Parameters
- identity
IGrantable
— The principal.
Returns
Grant the given identity permissions to start a synchronous execution of this state machine.
TaskResponse(identity)
grantpublic grantTaskResponse(identity: IGrantable): Grant
Parameters
- identity
IGrantable
— The principal.
Returns
Grant the given identity read permissions for this state machine.
metric(metricName, props?)
public metric(metricName: string, props?: MetricOptions): Metric
Parameters
- metricName
string
- props
Metric
Options
Returns
Return the given named metric for this State Machine's executions.
Aborted(props?)
metricpublic metricAborted(props?: MetricOptions): Metric
Parameters
- props
Metric
Options
Returns
Metric for the number of executions that were aborted.
Failed(props?)
metricpublic metricFailed(props?: MetricOptions): Metric
Parameters
- props
Metric
Options
Returns
Metric for the number of executions that failed.
Started(props?)
metricpublic metricStarted(props?: MetricOptions): Metric
Parameters
- props
Metric
Options
Returns
Metric for the number of executions that were started.
Succeeded(props?)
metricpublic metricSucceeded(props?: MetricOptions): Metric
Parameters
- props
Metric
Options
Returns
Metric for the number of executions that succeeded.
Throttled(props?)
metricpublic metricThrottled(props?: MetricOptions): Metric
Parameters
- props
Metric
Options
Returns
Metric for the number of executions that were throttled.
Time(props?)
metricpublic metricTime(props?: MetricOptions): Metric
Parameters
- props
Metric
Options
Returns
Metric for the interval, in milliseconds, between the time the execution starts and the time it closes.
TimedOut(props?)
metricpublic metricTimedOut(props?: MetricOptions): Metric
Parameters
- props
Metric
Options
Returns
Metric for the number of executions that timed out.