Service Integrations

This module provides classes to build steps that integrate with Amazon DynamoDB, Amazon SNS, Amazon SQS and Amazon EMR.

Table of Contents

Amazon DynamoDB

class stepfunctions.steps.service.DynamoDBGetItemStep(state_id, **kwargs)

Bases: stepfunctions.steps.states.Task

Creates a Task state to get an item from DynamoDB. See Call DynamoDB APIs 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.
  • 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.service.DynamoDBPutItemStep(state_id, **kwargs)

Bases: stepfunctions.steps.states.Task

Creates a Task state to put an item to DynamoDB. See Call DynamoDB APIs 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.
  • 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.service.DynamoDBDeleteItemStep(state_id, **kwargs)

Bases: stepfunctions.steps.states.Task

Creates a Task state to delete an item from DynamoDB. See Call DynamoDB APIs 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.
  • 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.service.DynamoDBUpdateItemStep(state_id, **kwargs)

Bases: stepfunctions.steps.states.Task

Creates a Task state to update an item from DynamoDB. See Call DynamoDB APIs 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.
  • 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: ‘$’)

Amazon SNS

class stepfunctions.steps.service.SnsPublishStep(state_id, wait_for_callback=False, **kwargs)

Bases: stepfunctions.steps.states.Task

Creates a Task state to publish a message to SNS topic. See Call Amazon SNS 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: ‘$’)

Amazon SQS

class stepfunctions.steps.service.SqsSendMessageStep(state_id, wait_for_callback=False, **kwargs)

Bases: stepfunctions.steps.states.Task

Creates a Task state to send a message to SQS queue. See Call Amazon SQS 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: ‘$’)

Amazon EMR

class stepfunctions.steps.service.EmrCreateClusterStep(state_id, wait_for_completion=True, **kwargs)

Bases: stepfunctions.steps.states.Task

Creates a Task state to create and start running a cluster (job flow). See Call Amazon EMR 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.
  • 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: ‘$’)
  • wait_for_completion (bool, optional) – Boolean value set to True if the Task state should wait to complete before proceeding to the next step in the workflow. (default: True)
class stepfunctions.steps.service.EmrTerminateClusterStep(state_id, wait_for_completion=True, **kwargs)

Bases: stepfunctions.steps.states.Task

Creates a Task state to shut down a cluster (job flow). See Call Amazon EMR 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.
  • 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: ‘$’)
  • wait_for_completion (bool, optional) – Boolean value set to True if the Task state should wait to complete before proceeding to the next step in the workflow. (default: True)
class stepfunctions.steps.service.EmrAddStepStep(state_id, wait_for_completion=True, **kwargs)

Bases: stepfunctions.steps.states.Task

Creates a Task state to add a new step to a running cluster. See Call Amazon EMR 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.
  • 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: ‘$’)
  • wait_for_completion (bool, optional) – Boolean value set to True if the Task state should wait to complete before proceeding to the next step in the workflow. (default: True)
class stepfunctions.steps.service.EmrCancelStepStep(state_id, **kwargs)

Bases: stepfunctions.steps.states.Task

Creates a Task state to cancel a pending step in a running cluster. See Call Amazon EMR 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.
  • 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.service.EmrSetClusterTerminationProtectionStep(state_id, **kwargs)

Bases: stepfunctions.steps.states.Task

Creates a Task state to lock a cluster (job flow) so the EC2 instances in the cluster cannot be terminated by user intervention, an API call, or a job-flow error. See Call Amazon EMR 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.
  • 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.service.EmrModifyInstanceFleetByNameStep(state_id, **kwargs)

Bases: stepfunctions.steps.states.Task

Creates a Task state to modify the target On-Demand and target Spot capacities for an instance fleet. See Call Amazon EMR 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.
  • 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.service.EmrModifyInstanceGroupByNameStep(state_id, **kwargs)

Bases: stepfunctions.steps.states.Task

Creates a Task state to modify the number of nodes and configuration settings of an instance group. See Call Amazon EMR 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.
  • 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: ‘$’)