airflow.providers.amazon.aws.operators.aws_lambda

Module Contents

Classes

AwsLambdaInvokeFunctionOperator

Invokes an AWS Lambda function.

class airflow.providers.amazon.aws.operators.aws_lambda.AwsLambdaInvokeFunctionOperator(*, function_name, log_type=None, qualifier=None, invocation_type=None, client_context=None, payload=None, aws_conn_id='aws_default', **kwargs)[source]

Bases: airflow.models.BaseOperator

Invokes an AWS Lambda function. You can invoke a function synchronously (and wait for the response), or asynchronously. To invoke a function asynchronously, set invocation_type to Event. For more details, review the boto3 Lambda invoke docs.

Parameters
  • function_name (str) -- The name of the AWS Lambda function, version, or alias.

  • payload (Optional[str]) -- The JSON string that you want to provide to your Lambda function as input.

  • log_type (Optional[str]) -- Set to Tail to include the execution log in the response. Otherwise, set to "None".

  • qualifier (Optional[str]) -- Specify a version or alias to invoke a published version of the function.

  • aws_conn_id (str) -- The AWS connection ID to use

See also

For more information on how to use this operator, take a look at the guide: Invoke an existing AWS Lambda function with a payload

template_fields :Sequence[str] = ['function_name', 'payload', 'qualifier', 'invocation_type'][source]
ui_color = #ff7300[source]
execute(self, context)[source]

Invokes the target AWS Lambda function from Airflow.

Returns

The response payload from the function, or an error object.

Was this entry helpful?