The Terraform jsondecode provider decodes a JSON string.
It provides a stopgap until this is supported in the Terraform configuration language; See hashicorp/terraform#10363.
This provider requires no configuration.
provider "jsondecode" {}
data "jsondecode_decode" "foo" {
input =<<EOS
{
"name": "Seattle",
"state": "WA"
}
EOS
}
The following arguments are supported:
input
- (Required, string) The JSON string that is to be decoded. The subset of JSON that can be decoded is limited - boolean, number, string, object with string values and array of strings.
The following attributes are exported in addition to the above configuration:
boolean
- (boolean) Booleannumber
- (float) Numberstring
- (string) Stringobject
- (map) Object with string valuesstring_array
- (list) Array of strings