function_recursion_configs
Creates, updates, deletes, gets or lists a function_recursion_configs resource.
Overview
| Name | function_recursion_configs |
| Type | Resource |
| Id | aws.lambda.function_recursion_configs |
Fields
The following fields are returned by SELECT queries:
- get_function_recursion_config
| Name | Datatype | Description |
|---|---|---|
recursive_loop | string | If your function's recursive loop detection configuration is Allow, Lambda doesn't take any action when it detects your function being invoked as part of a recursive loop. If your function's recursive loop detection configuration is Terminate, Lambda stops your function being invoked and notifies you when it detects your function being invoked as part of a recursive loop. By default, Lambda sets your function's configuration to Terminate. You can update this configuration using the PutFunctionRecursionConfig action. (Allow, Terminate) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_function_recursion_config | select | function_name, region | Returns your function's recursive loop detection configuration. | |
put_function_recursion_config | replace | function_name, region, RecursiveLoop | Sets your function's recursive loop detection configuration. When you configure a Lambda function to output to the same service or resource that invokes the function, it's possible to create an infinite recursive loop. For example, a Lambda function might write a message to an Amazon Simple Queue Service (Amazon SQS) queue, which then invokes the same function. This invocation causes the function to write another message to the queue, which in turn invokes the function again. Lambda can detect certain types of recursive loops shortly after they occur. When Lambda detects a recursive loop and your function's recursive loop detection configuration is set to Terminate, it stops your function being invoked and notifies you. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
function_name | string | The name or ARN of the Lambda function. Name formats Function name – my-function. Function ARN – arn:aws:lambda:us-west-2:123456789012:function:my-function. Partial ARN – 123456789012:function:my-function. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length. |
region | string | AWS region (default: us-east-1) |
SELECT examples
- get_function_recursion_config
Returns your function's recursive loop detection configuration.
SELECT
recursive_loop
FROM aws.lambda.function_recursion_configs
WHERE function_name = '{{ function_name }}' -- required
AND region = '{{ region }}' -- required
;
REPLACE examples
- put_function_recursion_config
Sets your function's recursive loop detection configuration. When you configure a Lambda function to output to the same service or resource that invokes the function, it's possible to create an infinite recursive loop. For example, a Lambda function might write a message to an Amazon Simple Queue Service (Amazon SQS) queue, which then invokes the same function. This invocation causes the function to write another message to the queue, which in turn invokes the function again. Lambda can detect certain types of recursive loops shortly after they occur. When Lambda detects a recursive loop and your function's recursive loop detection configuration is set to Terminate, it stops your function being invoked and notifies you.
REPLACE aws.lambda.function_recursion_configs
SET
RecursiveLoop = '{{ RecursiveLoop }}'
WHERE
function_name = '{{ function_name }}' --required
AND region = '{{ region }}' --required
AND RecursiveLoop = '{{ RecursiveLoop }}' --required
RETURNING
recursive_loop;