StateMachine

class aws_cdk.aws_stepfunctions.StateMachine(scope, id, *, definition, role=None, state_machine_name=None, timeout=None)

Bases: aws_cdk.core.Resource

Define a StepFunctions State Machine.

stability :stability: experimental

__init__(scope, id, *, definition, role=None, state_machine_name=None, timeout=None)
Parameters
  • scope (Construct) –

  • id (str) –

  • props

  • definition (IChainable) – Definition for this state machine.

  • role (Optional[IRole]) – The execution role for the state machine service. Default: A role is automatically created

  • state_machine_name (Optional[str]) – A name for the state machine. Default: A name is automatically generated

  • timeout (Optional[Duration]) – Maximum run time for this state machine. Default: No timeout

stability :stability: experimental

Return type

None

Methods

add_to_role_policy(statement)

Add the given statement to the role’s policy.

Parameters

statement (PolicyStatement) –

stability :stability: experimental

Return type

None

grant_start_execution(identity)

Grant the given identity permissions to start an execution of this state machine.

Parameters

identity (IGrantable) –

stability :stability: experimental

Return type

Grant

metric(metric_name, *, color=None, dimensions=None, label=None, period=None, statistic=None, unit=None)

Return the given named metric for this State Machine’s executions.

Parameters
  • metric_name (str) –

  • props

  • color (Optional[str]) – Color for this metric when added to a Graph in a Dashboard.

  • dimensions (Optional[Mapping[str, Any]]) – Dimensions of the metric. Default: - No dimensions.

  • label (Optional[str]) – Label for this metric when added to a Graph in a Dashboard.

  • period (Optional[Duration]) – The period over which the specified statistic is applied. Default: Duration.minutes(5)

  • statistic (Optional[str]) – What function to use for aggregating. Can be one of the following: - “Minimum” | “min” - “Maximum” | “max” - “Average” | “avg” - “Sum” | “sum” - “SampleCount | “n” - “pNN.NN” Default: Average

  • unit (Optional[Unit]) – Unit for the metric that is associated with the alarm.

default :default: sum over 5 minutes

stability :stability: experimental

Return type

Metric

metric_aborted(*, color=None, dimensions=None, label=None, period=None, statistic=None, unit=None)

Metric for the number of executions that were aborted.

Parameters
  • props

  • color (Optional[str]) – Color for this metric when added to a Graph in a Dashboard.

  • dimensions (Optional[Mapping[str, Any]]) – Dimensions of the metric. Default: - No dimensions.

  • label (Optional[str]) – Label for this metric when added to a Graph in a Dashboard.

  • period (Optional[Duration]) – The period over which the specified statistic is applied. Default: Duration.minutes(5)

  • statistic (Optional[str]) – What function to use for aggregating. Can be one of the following: - “Minimum” | “min” - “Maximum” | “max” - “Average” | “avg” - “Sum” | “sum” - “SampleCount | “n” - “pNN.NN” Default: Average

  • unit (Optional[Unit]) – Unit for the metric that is associated with the alarm.

default :default: sum over 5 minutes

stability :stability: experimental

Return type

Metric

metric_failed(*, color=None, dimensions=None, label=None, period=None, statistic=None, unit=None)

Metric for the number of executions that failed.

Parameters
  • props

  • color (Optional[str]) – Color for this metric when added to a Graph in a Dashboard.

  • dimensions (Optional[Mapping[str, Any]]) – Dimensions of the metric. Default: - No dimensions.

  • label (Optional[str]) – Label for this metric when added to a Graph in a Dashboard.

  • period (Optional[Duration]) – The period over which the specified statistic is applied. Default: Duration.minutes(5)

  • statistic (Optional[str]) – What function to use for aggregating. Can be one of the following: - “Minimum” | “min” - “Maximum” | “max” - “Average” | “avg” - “Sum” | “sum” - “SampleCount | “n” - “pNN.NN” Default: Average

  • unit (Optional[Unit]) – Unit for the metric that is associated with the alarm.

default :default: sum over 5 minutes

stability :stability: experimental

Return type

Metric

metric_started(*, color=None, dimensions=None, label=None, period=None, statistic=None, unit=None)

Metric for the number of executions that were started.

Parameters
  • props

  • color (Optional[str]) – Color for this metric when added to a Graph in a Dashboard.

  • dimensions (Optional[Mapping[str, Any]]) – Dimensions of the metric. Default: - No dimensions.

  • label (Optional[str]) – Label for this metric when added to a Graph in a Dashboard.

  • period (Optional[Duration]) – The period over which the specified statistic is applied. Default: Duration.minutes(5)

  • statistic (Optional[str]) – What function to use for aggregating. Can be one of the following: - “Minimum” | “min” - “Maximum” | “max” - “Average” | “avg” - “Sum” | “sum” - “SampleCount | “n” - “pNN.NN” Default: Average

  • unit (Optional[Unit]) – Unit for the metric that is associated with the alarm.

default :default: sum over 5 minutes

stability :stability: experimental

Return type

Metric

metric_succeeded(*, color=None, dimensions=None, label=None, period=None, statistic=None, unit=None)

Metric for the number of executions that succeeded.

Parameters
  • props

  • color (Optional[str]) – Color for this metric when added to a Graph in a Dashboard.

  • dimensions (Optional[Mapping[str, Any]]) – Dimensions of the metric. Default: - No dimensions.

  • label (Optional[str]) – Label for this metric when added to a Graph in a Dashboard.

  • period (Optional[Duration]) – The period over which the specified statistic is applied. Default: Duration.minutes(5)

  • statistic (Optional[str]) – What function to use for aggregating. Can be one of the following: - “Minimum” | “min” - “Maximum” | “max” - “Average” | “avg” - “Sum” | “sum” - “SampleCount | “n” - “pNN.NN” Default: Average

  • unit (Optional[Unit]) – Unit for the metric that is associated with the alarm.

default :default: sum over 5 minutes

stability :stability: experimental

Return type

Metric

metric_throttled(*, color=None, dimensions=None, label=None, period=None, statistic=None, unit=None)

Metric for the number of executions that were throttled.

Parameters
  • props

  • color (Optional[str]) – Color for this metric when added to a Graph in a Dashboard.

  • dimensions (Optional[Mapping[str, Any]]) – Dimensions of the metric. Default: - No dimensions.

  • label (Optional[str]) – Label for this metric when added to a Graph in a Dashboard.

  • period (Optional[Duration]) – The period over which the specified statistic is applied. Default: Duration.minutes(5)

  • statistic (Optional[str]) – What function to use for aggregating. Can be one of the following: - “Minimum” | “min” - “Maximum” | “max” - “Average” | “avg” - “Sum” | “sum” - “SampleCount | “n” - “pNN.NN” Default: Average

  • unit (Optional[Unit]) – Unit for the metric that is associated with the alarm.

default :default: sum over 5 minutes

stability :stability: experimental

Return type

Metric

metric_time(*, color=None, dimensions=None, label=None, period=None, statistic=None, unit=None)

Metric for the interval, in milliseconds, between the time the execution starts and the time it closes.

Parameters
  • props

  • color (Optional[str]) – Color for this metric when added to a Graph in a Dashboard.

  • dimensions (Optional[Mapping[str, Any]]) – Dimensions of the metric. Default: - No dimensions.

  • label (Optional[str]) – Label for this metric when added to a Graph in a Dashboard.

  • period (Optional[Duration]) – The period over which the specified statistic is applied. Default: Duration.minutes(5)

  • statistic (Optional[str]) – What function to use for aggregating. Can be one of the following: - “Minimum” | “min” - “Maximum” | “max” - “Average” | “avg” - “Sum” | “sum” - “SampleCount | “n” - “pNN.NN” Default: Average

  • unit (Optional[Unit]) – Unit for the metric that is associated with the alarm.

default :default: sum over 5 minutes

stability :stability: experimental

Return type

Metric

metric_timed_out(*, color=None, dimensions=None, label=None, period=None, statistic=None, unit=None)

Metric for the number of executions that succeeded.

Parameters
  • props

  • color (Optional[str]) – Color for this metric when added to a Graph in a Dashboard.

  • dimensions (Optional[Mapping[str, Any]]) – Dimensions of the metric. Default: - No dimensions.

  • label (Optional[str]) – Label for this metric when added to a Graph in a Dashboard.

  • period (Optional[Duration]) – The period over which the specified statistic is applied. Default: Duration.minutes(5)

  • statistic (Optional[str]) – What function to use for aggregating. Can be one of the following: - “Minimum” | “min” - “Maximum” | “max” - “Average” | “avg” - “Sum” | “sum” - “SampleCount | “n” - “pNN.NN” Default: Average

  • unit (Optional[Unit]) – Unit for the metric that is associated with the alarm.

default :default: sum over 5 minutes

stability :stability: experimental

Return type

Metric

to_string()

Returns a string representation of this construct.

Return type

str

Attributes

node

Construct tree node which offers APIs for interacting with the construct tree.

Return type

ConstructNode

role

Execution role of this state machine.

stability :stability: experimental

Return type

IRole

stack

The stack in which this resource is defined.

Return type

Stack

state_machine_arn

The ARN of the state machine.

stability :stability: experimental

Return type

str

state_machine_name

The name of the state machine.

stability :stability: experimental attribute: :attribute:: true

Return type

str

Static Methods

classmethod from_state_machine_arn(scope, id, state_machine_arn)

Import a state machine.

Parameters
  • scope (Construct) –

  • id (str) –

  • state_machine_arn (str) –

stability :stability: experimental

Return type

IStateMachine

classmethod is_construct(x)

Return whether the given object is a Construct.

Parameters

x (Any) –

Return type

bool