AWS Lambda

AWS Lambda Task state.

class rhodes.states.services.awslambda.AwsLambda(title, *, Comment=None, FunctionName=None, Payload=None, ClientContext=None, InvocationType=None, Qualifier=None, Next=None, End=None, InputPath=JsonPath(path=Root()), OutputPath=JsonPath(path=Root()), ResultPath=JsonPath(path=Root()), Retry=None, Catch=None, TimeoutSeconds=None, HeartbeatSeconds=None, Pattern=<IntegrationPattern.REQUEST_RESPONSE: ''>)[source]

Bases: rhodes.states.State

Invoke a Lambda function.

See service docs for more details.

Parameters:
  • FunctionName – AWS Lambda Function to call
  • Payload (Parameters, JsonPath, AWSHelperFn, dict, str, or Enum) – Data to provide to the Lambda Function as input
  • ClientContext (JsonPath, AWSHelperFn, str, or Enum) – Up to 3583 bytes of base64-encoded data about the invoking client to pass to the function in the context object
  • InvocationType (JsonPath, AWSHelperFn, str, or Enum) – Determines how the Lambda Function is invoked
  • Qualifier (JsonPath, AWSHelperFn, str, or Enum) – Version or alias of the Lambda Function to invoke
  • title (str) – Name of state in state machine
  • Comment (str) – Human-readable description of the state (default: '')
  • Next – The state that will follow this state
  • End (bool) – This state is a terminal state
  • InputPath (JsonPath) – The portion of the state input data to be used as input for the state (default: JsonPath(path=Root()))
  • OutputPath (JsonPath) – The portion of the state input data to be passed to the next state (default: JsonPath(path=Root()))
  • ResultPath (JsonPath) – Where in the state input data to place the results of this state (default: JsonPath(path=Root()))
  • Retry
  • Catch
  • TimeoutSeconds (int) – Maximum time that this state is allowed to run
  • HeartbeatSeconds (int) – Maximum time allowed between heartbeat responses from state
  • Pattern (IntegrationPattern) – Step Functions integration pattern (default: <IntegrationPattern.REQUEST_RESPONSE: ''>)
end()

Make this state a terminal state.

member_of = None
promote(path)

Add a Pass state after this state that promotes a path in the input to this state’s ResultPath.

Path must start with a path relative this state’s ResultPath as indicated by a @. prefix.

Parameters:path (Union[str, Enum, JSONPath, JsonPath]) – Path to promote
Return type:Pass
then(next_state)

Set the next state in this state machine.

to_dict() → Dict[KT, VT]

Serialize state as a dictionary.

Return type:Dict