aws_ddk_core.pipelines.StateMachineStage

class aws_ddk_core.pipelines.StateMachineStage(*args: Any, **kwargs)

DataStage with helper methods to simplify StateMachine stages creation.

__init__(scope: constructs.Construct, id: str, name: Optional[str] = None, description: Optional[str] = None, alarms_enabled: Optional[bool] = True) None

Create a stage.

Parameters
  • scope (Construct) – Scope within which this construct is defined

  • id (str) – Identifier of the stage

  • name (Optional[str]) – Name of the stage

  • description (Optional[str]) – Description of the stage

  • alarms_enabled (Optional[bool]) – Enable/Disable all alarms in a DataStage. Default - True

Methods

__init__(scope, id[, name, description, ...])

Create a stage.

add_alarm(alarm_id, alarm_metric[, ...])

Add a CloudWatch alarm for the Data Stage

build_state_machine(id, environment_id, ...)

Build state machine.

get_event_pattern()

Get output event pattern of the stage.

get_targets()

Get input targets of the stage.

is_construct(x)

Checks if x is a construct.

to_string()

Returns a string representation of this construct.

Attributes

cloudwatch_alarms

List[Alarm] List of CloudWatch Alarms linked to the stage

node

The tree node.

state_machine

StateMachine The state machine

build_state_machine(id: str, environment_id: str, definition: Optional[aws_cdk.aws_stepfunctions.IChainable], state_machine_input: Optional[Dict[str, Any]] = None, additional_role_policy_statements: Optional[List[aws_cdk.aws_iam.PolicyStatement]] = None, state_machine_failed_executions_alarm_threshold: Optional[int] = 1, state_machine_failed_executions_alarm_evaluation_periods: Optional[int] = 1, **kwargs: Any) None

Build state machine.

Parameters
  • id (str) – Identifier of the state machine

  • environment_id (str) – Identifier of the environment

  • definition (Optional[IChainable]) – State machine definition

  • state_machine_input (Optional[Dict[str, Any]]) – Input of the state machine

  • additional_role_policy_statements (Optional[List[PolicyStatement]]) – Additional IAM policy statements to add to the state machine role

  • state_machine_failed_executions_alarm_threshold (Optional[int]) – The number of failed state machine executions before triggering CW alarm. Defaults to 1

  • state_machine_failed_executions_alarm_evaluation_periods (Optional[int]) – The number of periods over which data is compared to the specified threshold. Defaults to 1

  • kwargs (Any) – Additional paramaters to pass to State Machine creation.

get_event_pattern() Optional[aws_cdk.aws_events.EventPattern]

Get output event pattern of the stage.

Event pattern describes the structure of output event(s) produced by this stage. Event Rules use event patterns to select events and route them to targets.

Returns

event_pattern – Event pattern

Return type

Optional[EventPattern]

get_targets() Optional[List[aws_cdk.aws_events.IRuleTarget]]

Get input targets of the stage.

Targets are used by Event Rules to describe what should be invoked when a rule matches an event.

Returns

targets – List of targets

Return type

Optional[List[IRuleTarget]]

property state_machine: aws_cdk.aws_stepfunctions.StateMachine

StateMachine The state machine

Type

Return