airflow.providers.amazon.aws.operators.lambda_function

Module Contents

Classes

AwsLambdaInvokeFunctionOperator

Invokes an AWS Lambda function.

class airflow.providers.amazon.aws.operators.lambda_function.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 (str | None) – The JSON string that you want to provide to your Lambda function as input.

  • log_type (str | None) – Set to Tail to include the execution log in the response. Otherwise, set to “None”.

  • qualifier (str | None) – 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 AWS Lambda function

template_fields :Sequence[str] = ['function_name', 'payload', 'qualifier', 'invocation_type'][source]
ui_color = #ff7300[source]
execute(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?