Compute

This module provides classes to build steps that integrate with AWS Lambda, AWS Batch, AWS Glue, and Amazon ECS.

class stepfunctions.steps.compute.LambdaStep(state_id, wait_for_callback=False, **kwargs)

Bases: stepfunctions.steps.states.Task

Creates a Task state to invoke an AWS Lambda function. See Invoke Lambda with Step Functions for more details.

Parameters:
  • state_id (str) – State name whose length must be less than or equal to 128 unicode characters. State names must be unique within the scope of the whole state machine.
  • wait_for_callback (bool, optional) – Boolean value set to True if the Task state should wait for callback to resume the operation. (default: False)
  • timeout_seconds (int, optional) – Positive integer specifying timeout for the state in seconds. If the state runs longer than the specified timeout, then the interpreter fails the state with a States.Timeout Error Name. (default: 60)
  • heartbeat_seconds (int, optional) – Positive integer specifying heartbeat timeout for the state in seconds. This value should be lower than the one specified for timeout_seconds. If more time than the specified heartbeat elapses between heartbeats from the task, then the interpreter fails the state with a States.Timeout Error Name.
  • comment (str, optional) – Human-readable comment or description. (default: None)
  • input_path (str, optional) – Path applied to the state’s raw input to select some or all of it; that selection is used by the state. (default: ‘$’)
  • parameters (dict, optional) – The value of this field becomes the effective input for the state.
  • result_path (str, optional) – Path specifying the raw input’s combination with or replacement by the state’s result. (default: ‘$’)
  • output_path (str, optional) – Path applied to the state’s output after the application of result_path, producing the effective output which serves as the raw input for the next state. (default: ‘$’)
class stepfunctions.steps.compute.GlueStartJobRunStep(state_id, wait_for_completion=True, **kwargs)

Bases: stepfunctions.steps.states.Task

Creates a Task state to run an AWS Glue job. See Manage AWS Glue Jobs with Step Functions for more details.

Parameters:
  • state_id (str) – State name whose length must be less than or equal to 128 unicode characters. State names must be unique within the scope of the whole state machine.
  • wait_for_completion (bool, optional) – Boolean value set to True if the Task state should wait for the glue job to complete before proceeding to the next step in the workflow. Set to False if the Task state should submit the glue job and proceed to the next step. (default: True)
  • timeout_seconds (int, optional) – Positive integer specifying timeout for the state in seconds. If the state runs longer than the specified timeout, then the interpreter fails the state with a States.Timeout Error Name. (default: 60)
  • heartbeat_seconds (int, optional) – Positive integer specifying heartbeat timeout for the state in seconds. This value should be lower than the one specified for timeout_seconds. If more time than the specified heartbeat elapses between heartbeats from the task, then the interpreter fails the state with a States.Timeout Error Name.
  • comment (str, optional) – Human-readable comment or description. (default: None)
  • input_path (str, optional) – Path applied to the state’s raw input to select some or all of it; that selection is used by the state. (default: ‘$’)
  • parameters (dict, optional) – The value of this field becomes the effective input for the state.
  • result_path (str, optional) – Path specifying the raw input’s combination with or replacement by the state’s result. (default: ‘$’)
  • output_path (str, optional) – Path applied to the state’s output after the application of result_path, producing the effective output which serves as the raw input for the next state. (default: ‘$’)
class stepfunctions.steps.compute.BatchSubmitJobStep(state_id, wait_for_completion=True, **kwargs)

Bases: stepfunctions.steps.states.Task

Creates a Task State to start an AWS Batch job. See Manage AWS Batch with Step Functions for more details.

Parameters:
  • state_id (str) – State name whose length must be less than or equal to 128 unicode characters. State names must be unique within the scope of the whole state machine.
  • wait_for_completion (bool, optional) – Boolean value set to True if the Task state should wait for the batch job to complete before proceeding to the next step in the workflow. Set to False if the Task state should submit the batch job and proceed to the next step. (default: True)
  • timeout_seconds (int, optional) – Positive integer specifying timeout for the state in seconds. If the state runs longer than the specified timeout, then the interpreter fails the state with a States.Timeout Error Name. (default: 60)
  • heartbeat_seconds (int, optional) – Positive integer specifying heartbeat timeout for the state in seconds. This value should be lower than the one specified for timeout_seconds. If more time than the specified heartbeat elapses between heartbeats from the task, then the interpreter fails the state with a States.Timeout Error Name.
  • comment (str, optional) – Human-readable comment or description. (default: None)
  • input_path (str, optional) – Path applied to the state’s raw input to select some or all of it; that selection is used by the state. (default: ‘$’)
  • parameters (dict, optional) – The value of this field becomes the effective input for the state.
  • result_path (str, optional) – Path specifying the raw input’s combination with or replacement by the state’s result. (default: ‘$’)
  • output_path (str, optional) – Path applied to the state’s output after the application of result_path, producing the effective output which serves as the raw input for the next state. (default: ‘$’)
class stepfunctions.steps.compute.EcsRunTaskStep(state_id, wait_for_completion=True, **kwargs)

Bases: stepfunctions.steps.states.Task

Creates a Task State to run Amazon ECS or Fargate Tasks. See Manage Amazon ECS or Fargate Tasks with Step Functions for more details.

Parameters:
  • state_id (str) – State name whose length must be less than or equal to 128 unicode characters. State names must be unique within the scope of the whole state machine.
  • wait_for_completion (bool, optional) – Boolean value set to True if the Task state should wait for the ecs job to complete before proceeding to the next step in the workflow. Set to False if the Task state should submit the ecs job and proceed to the next step. (default: True)
  • timeout_seconds (int, optional) – Positive integer specifying timeout for the state in seconds. If the state runs longer than the specified timeout, then the interpreter fails the state with a States.Timeout Error Name. (default: 60)
  • heartbeat_seconds (int, optional) – Positive integer specifying heartbeat timeout for the state in seconds. This value should be lower than the one specified for timeout_seconds. If more time than the specified heartbeat elapses between heartbeats from the task, then the interpreter fails the state with a States.Timeout Error Name.
  • comment (str, optional) – Human-readable comment or description. (default: None)
  • input_path (str, optional) – Path applied to the state’s raw input to select some or all of it; that selection is used by the state. (default: ‘$’)
  • parameters (dict, optional) – The value of this field becomes the effective input for the state.
  • result_path (str, optional) – Path specifying the raw input’s combination with or replacement by the state’s result. (default: ‘$’)
  • output_path (str, optional) – Path applied to the state’s output after the application of result_path, producing the effective output which serves as the raw input for the next state. (default: ‘$’)