Amazon Lambda function reference
Following is the reference for the functions to use for invoking Lambda functions 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 Amazon Lambda Developer Guide.
Syntax
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 Amazon 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 Amazon Region from the full ARN in the
function_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:
-
RequestResponse
– The default. This type of invocation for a Lambda function is synchronous and returns a response payload in the result. Use theRequestResponse
invocation type when your workflow depends on receiving the Lambda function result immediately. -
Event
– This type of invocation for a Lambda function is asynchronous and returns immediately without a returned payload. Use theEvent
invocation type when you don't need results of the Lambda function before your workflow moves on. -
DryRun
– This type of invocation tests access without running the Lambda function.
-
- 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:-
Tail – The returned
log_result
output parameter will include the last 4 KB of the execution log. -
None – No Lambda log information is returned.
-
- context
-
Client context in JSON or JSONB format. Fields to use include than
custom
andenv
. - qualifier
-
A qualifier that identifies a Lambda function's version to be invoked. If this value conflicts with one provided in the
function_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 Amazon 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 isTail
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 the
aws_commons.create_lambda_function_arn
function in the
function_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 Amazon Region that the Lambda function is in. For a listing of Region names and associated values, see Regions, Availability Zones, and Local Zones.