RunLambdaTask

class aws_cdk.aws_stepfunctions_tasks.RunLambdaTask(lambda_function, *, client_context=None, integration_pattern=None, invocation_type=None, payload=None, qualifier=None)

Bases: object

(deprecated) Invoke a Lambda function as a Task.

OUTPUT: the output of this task is either the return value of Lambda’s Invoke call, or whatever the Lambda Function posted back using SendTaskSuccess/SendTaskFailure in waitForTaskToken mode.

Deprecated

Use LambdaInvoke

See

https://docs.aws.amazon.com/step-functions/latest/dg/connect-lambda.html

Stability

deprecated

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_lambda as lambda_
import aws_cdk.aws_stepfunctions as stepfunctions
import aws_cdk.aws_stepfunctions_tasks as stepfunctions_tasks

# function_: lambda.Function
# task_input: stepfunctions.TaskInput

run_lambda_task = stepfunctions_tasks.RunLambdaTask(function_,
    client_context="clientContext",
    integration_pattern=stepfunctions.ServiceIntegrationPattern.FIRE_AND_FORGET,
    invocation_type=stepfunctions_tasks.InvocationType.REQUEST_RESPONSE,
    payload=task_input,
    qualifier="qualifier"
)
Parameters
  • lambda_function (IFunction) –

  • client_context (Optional[str]) – (deprecated) Client context to pass to the function. Default: - No context

  • integration_pattern (Optional[ServiceIntegrationPattern]) – (deprecated) The service integration pattern indicates different ways to invoke Lambda function. The valid value for Lambda is either FIRE_AND_FORGET or WAIT_FOR_TASK_TOKEN, it determines whether to pause the workflow until a task token is returned. If this is set to WAIT_FOR_TASK_TOKEN, the JsonPath.taskToken value must be included somewhere in the payload and the Lambda must call SendTaskSuccess/SendTaskFailure using that token. Default: FIRE_AND_FORGET

  • invocation_type (Optional[InvocationType]) – (deprecated) Invocation type of the Lambda function. Default: RequestResponse

  • payload (Optional[TaskInput]) – (deprecated) The JSON that you want to provide to your Lambda function as input. Default: - The state input (JSON path ‘$’)

  • qualifier (Optional[str]) – (deprecated) Version or alias of the function to be invoked. Default: - No qualifier

Stability

deprecated

Methods

bind(_task)

(deprecated) Called when the task object is used in a workflow.

Parameters

_task (Task) –

Stability

deprecated

Return type

StepFunctionsTaskConfig