terraform-provider-google: 2.20.0 breaks google_compute_region_backend_service with "backend.0.group": required field is not set

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave “+1” or “me too” comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment
  • If an issue is assigned to the “modular-magician” user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned to “hashibot”, a community member has claimed the issue already.

Terraform Version

Terraform v0.11.14

  • provider.google v2.20.0
  • provider.google-beta v2.20.0
  • provider.template v2.1.2

Affected Resource(s)

  • google_compute_region_backend_service

Terraform Configuration Files

variable "backends" {
  type = "list"
  default = [
    {
      group = "${local.instance_group[0]}"
    },
    {
      group = "${local.instance_group[1]}"
    },
    {
      group = "${local.instance_group[2]}"
    },
  ]
}

resource "google_compute_region_backend_service" "internal" {
  name                  = "${local.backend_service_name}"
  project               = "${local.project_id}"
  region                = "${var.region}"
  health_checks         = ["${local.health_checks}"]
  load_balancing_scheme = "INTERNAL"
  session_affinity      = "${var.session_affinity}"
  protocol              = "${var.ip_protocol}"
  backend               = ["${var.backends}"]
}

Debug Output

https://gist.github.com/korjik/70eb44a79671cb4d686ae3c0a0ede1c2

Expected Behavior

terraform plan works fine

Actual Behavior

Terrafrom plan breaks with:

google_compute_region_backend_service.internal: “backend.0.group”: required field is not set

Steps to Reproduce

  1. Use Google provider 2.19.0 and run terraform plan over a resource google_compute_region_backend_service - all works fine
  2. Change provider to 2.20.0 and the error will be thrown

b/309764960

About this issue

  • Original URL
  • State: open
  • Created 5 years ago
  • Reactions: 17
  • Comments: 16 (4 by maintainers)

Commits related to this issue

Most upvoted comments

On a sidenote, I fixed my issue because I was referencing the self link of the IG instead of the instance group parameter.

instance_group            = "https://www.googleapis.com/compute/v1/projects/REDACTED/regions/europe-west2/instanceGroups/appserver-igm" 

self_link                 = "https://www.googleapis.com/compute/v1/projects/REDACTED/regions/europe-west2/instanceGroupManagers/appserver-igm" 

Will it be possible to use the self link to reference the IG instead of the instance group parameter?

Thanks