-
Notifications
You must be signed in to change notification settings - Fork 601
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
BUG: JSON decodes array of structs wrong #209
Comments
This just bit us also when moving from direct hcl files to json files. |
So, we're running into this now too. Patched in some print lines to verify a hunch that this was happening during the flattening phase.
...and it sure seems like it. I'm not informed enough on the actual purpose of the flattening step to be able to fix it, though. The one case I can find where its doing something is this one, where it's creating undesirable behavior. |
I'm running into similar issue but looks like it is a hcl decoder problem. |
This is for sure a bug - I ran into it using Unfortunately, this bug is also present in how Terraform parses JSON - Running I was able to work around it in the Example JSON: // <SNIP>
"module": {
"container_load_balancer": {
"health_check": [
"${var.container_health_check}"
],
"internal": false,
"listener": [
{
"instance_port": 80,
"instance_protocol": "HTTP",
"lb_port": 443,
"lb_protocol": "HTTPS",
"ssl_certificate_id": "${aws_iam_server_certificate.domain.arn}"
}
],
"name": "${var.phase}-container-hosts",
"security_groups": [
"${module.egress_all_security_group.this_security_group_id}",
"${module.http_security_group.this_security_group_id}"
],
"source": "terraform-aws-modules/elb/aws",
"subnets": "${module.vpc.public_subnets}",
"tags": "${var.tags}"
}
},
// <SNIP> Error output:
... when |
Will this work properly in HCL2? I wanted to try it out in Terraform 0.12 alpha, but would've had to recompile a provider for the new plugin protocol version. |
The JSON parser of the hcl package decodes two elements for the inner array instead of one:
Here is the Go test to verify this:
The text was updated successfully, but these errors were encountered: