AWS Lambda function and parameter reference (original) (raw)

Following is the reference for the functions and parameters to use for invoking Lambda with RDS for PostgreSQL.

aws_lambda.invoke

Runs a Lambda function for an RDS for PostgreSQL DB instance.

For more details about invoking Lambda functions, see also Invoke in the AWS Lambda Developer Guide.

Syntax

JSON

aws_lambda.invoke(
IN function_name TEXT,
IN payload JSON,
IN region TEXT DEFAULT NULL,
IN invocation_type TEXT DEFAULT 'RequestResponse',
IN log_type TEXT DEFAULT 'None',
IN context JSON DEFAULT NULL,
IN qualifier VARCHAR(128) DEFAULT NULL,
OUT status_code INT,
OUT payload JSON,
OUT executed_version TEXT,
OUT log_result TEXT)
aws_lambda.invoke(
IN function_name aws_commons._lambda_function_arn_1,
IN payload JSON,
IN invocation_type TEXT DEFAULT 'RequestResponse',
IN log_type TEXT DEFAULT 'None',
IN context JSON DEFAULT NULL,
IN qualifier VARCHAR(128) DEFAULT NULL,
OUT status_code INT,
OUT payload JSON,
OUT executed_version TEXT,
OUT log_result TEXT)

JSONB

aws_lambda.invoke(
IN function_name TEXT,
IN payload JSONB,
IN region TEXT DEFAULT NULL,
IN invocation_type TEXT DEFAULT 'RequestResponse',
IN log_type TEXT DEFAULT 'None',
IN context JSONB DEFAULT NULL,
IN qualifier VARCHAR(128) DEFAULT NULL,
OUT status_code INT,
OUT payload JSONB,
OUT executed_version TEXT,
OUT log_result TEXT)
aws_lambda.invoke(
IN function_name aws_commons._lambda_function_arn_1,
IN payload JSONB,
IN invocation_type TEXT DEFAULT 'RequestResponse',
IN log_type TEXT DEFAULT 'None',
IN context JSONB DEFAULT NULL,
IN qualifier VARCHAR(128) DEFAULT NULL,
OUT status_code INT,
OUT payload JSONB,
OUT executed_version TEXT,
OUT log_result TEXT
)
Input parameters

_function_name

The identifying name of the Lambda function. The value can be the function name, an ARN, or a partial ARN. For a listing of possible formats, see Lambda function name formats in the AWS Lambda Developer Guide.

payload

The input for the Lambda function. The format can be JSON or JSONB. For more information, see JSON Types in the PostgreSQL documentation.

region

(Optional) The Lambda Region for the function. By default, RDS resolves the AWS Region from the full ARN in thefunction_name or it uses the RDS for PostgreSQL DB instance Region. If this Region value conflicts with the one provided in thefunction_name ARN, an error is raised.

invocation_type

The invocation type of the Lambda function. The value is case-sensitive. Possible values include the following:

log_type

The type of Lambda log to return in the log_result output parameter. The value is case-sensitive. Possible values include the following:

context

Client context in JSON or JSONB format. Fields to use include thancustom and env.

qualifier

A qualifier that identifies a Lambda function's version to be invoked. If this value conflicts with one provided in thefunction_name ARN, an error is raised.

Output parameters

status_code

An HTTP status response code. For more information, see Lambda Invoke response elements in the AWS Lambda Developer Guide.

payload

The information returned from the Lambda function that ran. The format is in JSON or JSONB.

executed_version

The version of the Lambda function that ran.

log_result

The execution log information returned if the log_type value is Tail when the Lambda function was invoked. The result contains the last 4 KB of the execution log encoded in Base64.

aws_commons.create_lambda_function_arn

Creates an aws_commons._lambda_function_arn_1 structure to hold Lambda function name information. You can use the results of theaws_commons.create_lambda_function_arn function in thefunction_name parameter of the aws_lambda.invoke aws_lambda.invoke function.

Syntax

aws_commons.create_lambda_function_arn(
    function_name TEXT,
    region TEXT DEFAULT NULL
    )
    RETURNS aws_commons._lambda_function_arn_1
Input parameters

function_name

A required text string containing the Lambda function name. The value can be a function name, a partial ARN, or a full ARN.

region

An optional text string containing the AWS Region that the Lambda function is in. For a listing of Region names and associated values, seeRegions, Availability Zones, and Local Zones.

aws_lambda parameters

In this table, you can find parameters associated with the aws_lambda function.

Parameter Description
aws_lambda.connect_timeout_ms This is a dynamic parameter and it sets the maximum wait time while connecting to AWS Lambda. The default values is 1000. Allowed values for this parameter are 1 - 900000.
aws_lambda.request_timeout_ms This is a dynamic parameter and it sets the maximum wait time while waiting for response from AWS Lambda. The default values is 3000. Allowed values for this parameter are 1 - 900000.
aws_lambda.endpoint_override Specifies the endpoint that can be used to connect to AWS Lambda. An empty string selects the default AWS Lambda endpoint for the region. You must restart the database for this static parameter change to take effect.