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 = "${data.aws_lambda_invocation.result_map["key1"]}"
}

output "result" {
  value = "${data.aws_lambda_invocation.result}"
}

Argument Reference

  • function_name - (Required) The name of the lambda function.
  • input - (Required) A string in JSON format that is passed as payload to the lambda function.
  • qualifier - (Optional) The qualifier (a.k.a version) of the lambda function. Defaults to $LATEST.

Attributes Reference

  • result - A result of the lambda function invocation.
  • result_map - This field is set only if result is a map of primitive types.

© 2018 HashiCorp
Licensed under the MPL 2.0 License.
https://www.terraform.io/docs/providers/aws/d/lambda_invocation.html