Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs/data-source/aws_lambda_invocation: Add information about jsondecode() in Terraform 0.12 #9190

Merged
merged 1 commit into from
Jul 2, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions website/docs/d/lambda_invocation.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,21 @@ data "aws_lambda_invocation" "example" {
JSON
}

output "result_entry" {
output "result" {
description = "String result of Lambda execution"
value = "${data.aws_lambda_invocation.example.result}"
}

# In Terraform 0.11 and earlier, the result_map attribute can be used
# to convert a result JSON string to a map of string keys to string values.
output "result_entry_tf011" {
value = "${data.aws_lambda_invocation.example.result_map["key1"]}"
}

output "result" {
value = "${data.aws_lambda_invocation.example.result}"
# In Terraform 0.12 and later, the jsondecode() function can be used
# to convert a result JSON string to native Terraform types.
output "result_entry_tf012" {
value = jsondecode(data.aws_lambda_invocation.example.result)["key1"]
}
```

Expand All @@ -44,5 +53,5 @@ output "result" {

## 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.
* `result` - String result of the lambda function invocation.
* `result_map` - This field is set only if result is a map of primitive types, where the map is string keys and string values. In Terraform 0.12 and later, use the [`jsondecode()` function](/docs/configuration/functions/jsondecode.html) with the `result` attribute instead to convert the result to all supported native Terraform types.