In the
Jsonnet post from a few years ago, the output.json example shows resources being configured like:
"web_elb": {
"instances": [
"web"
],
"kind": "Terraform#Aws#ElasticLoadBalancer",
"listener": {
"instance_port": 80,
"instance_protocol": "http",
"lb_port": 80,
"lb_protocol": "http"
},
"name": "terraform-example-elb"
}
This is in contrast to the documented, more rigid way of configuring resources in Terraform:
"resource": {
"aws_elb": {
"web_elb": {
...
}
}
}
Based on output.json I started trying to define GCP resources the same way, e.g.:
"dev-us-central1-private-subnet": {
"kind": "Terraform#Gcp#GoogleComputeSubnetwork",
"name": "dev-us-central1-private",
"network": "${google_compute_network.dev.self_link}",
"region": "us-central1"
},
But if I try this, Terraform complains:
* Unknown root level key: dev-us-central1-private-subnet
Is this not supported? Was it an old way of doing things? It happens to be much more flexible when generating config with Jsonnet and taking advantage of nested loops and maps, so I hope it works.
Thanks.