Data Source: aws_lambda_invocation
Use this data source to invoke custom lambda functions as data source.
The lambda function is invoked with RequestResponse
invocation type.
Example Usage
data "aws_lambda_invocation" "example" {
function_name = aws_lambda_function.lambda_function_test.function_name
input = <<JSON
{
"key1": "value1",
"key2": "value2"
}
JSON
}
output "result_entry" {
value = jsondecode(data.aws_lambda_invocation.example.result)["key1"]
}
Argument Reference
function_name
- (Required) Name of the lambda function.
input
- (Required) String in JSON format that is passed as payload to the lambda function.
qualifier
- (Optional) Qualifier (a.k.a version) of the lambda function. Defaults
to $LATEST
.
Attribute Reference
This data source exports the following attributes in addition to the arguments above:
result
- String result of the lambda function invocation.