You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
module"mig1" {
source="GoogleCloudPlatform/managed-instance-group/google"project="${google_project_services.apis.project}"region="us-west1"zone="us-west1-b"name="group1"size="2"target_tags=["allow-group1"]
service_port=80service_port_name="http"startup_script="${data.template_file.group-startup-script.rendered}"
}
module"mig2" {
source="GoogleCloudPlatform/managed-instance-group/google"project="${google_project_services.apis.project}"region="us-east1"zone="us-east1-b"name="group2"size="2"target_tags=["allow-group2"]
service_port=80service_port_name="http"startup_script="${data.template_file.group-startup-script.rendered}"
}
module"lb-http" {
# source = "GoogleCloudPlatform/lb-http/google"source="/Users/danahoffman/go/src/github.com/GoogleCloudPlatform/terraform-google-lb-http"project="${google_project_services.apis.project}"name="global-lb-http"target_tags=["${module.mig1.target_tags}", "${module.mig2.target_tags}"]
backends={
"0"= [
{
group ="${module.mig1.instance_group}"
},
{
group ="${module.mig2.instance_group}"
},
]
}
backend_params=[
// health check path, port name, port number, timeout seconds."/,http,80,10",
]
}
The important block there is backends inside the lb-http module.
Since my google provider is at master, google_backend_service.backend.group is a Required field. Running terraform plan for this config gives the error: * module.lb-http.google_compute_backend_service.default: "backend.0.group": required field is not set.
If I rebuild and change group to Optional, it applies just fine, so it's clearly able to map these variables to the appropriate resource. Setting the fields to explicit values also works. The error only comes up when group is a required field and I try to set it to an output from another module.
(and just as an fyi, the only changes I made to the module itself are to add the project field to more resources, so the fact that it's using a local version of the module shouldn't make a difference for a repro)
So whoever debugs this doesn't have to look it up, this is what backend looks like within resource_compute_backend_service.go:
Terraform Version
0.10.7
terraform-provider-google built at master
Terraform Configuration Files
The important block there is
backends
inside thelb-http
module.Since my google provider is at master,
google_backend_service.backend.group
is aRequired
field. Runningterraform plan
for this config gives the error:* module.lb-http.google_compute_backend_service.default: "backend.0.group": required field is not set
.If I rebuild and change
group
toOptional
, it applies just fine, so it's clearly able to map these variables to the appropriate resource. Setting the fields to explicit values also works. The error only comes up when group is a required field and I try to set it to an output from another module.(and just as an fyi, the only changes I made to the module itself are to add the project field to more resources, so the fact that it's using a local version of the module shouldn't make a difference for a repro)
So whoever debugs this doesn't have to look it up, this is what
backend
looks like within resource_compute_backend_service.go:Trace logs here, though I took a quick look through and didn't see anything that looked useful: https://gist.github.com/danawillow/bdf9d68641aebb0a2b2afbb38b29cf4d
The text was updated successfully, but these errors were encountered: