1 year ago

#372741

test-img

kom

Terraform syntax error when using google cloud shell

I got the error when I use the terraform in cloud shell(google cloud) Terraform version is v1.1.7 It says

Error: Unsupported attribute

ā”‚   on main.tf line 75, in resource "google_compute_backend_service" "gke":
ā”‚   75:     group = replace(element(google_container_cluster.default.instance_group_urls, 1), "Manager","")
ā”‚ This object has no argument, nested block, or exported attribute named "instance_group_urls".

Probably a years ago, it works properly in same tf file. I did not remember which terraform version I use in that time. How I modify the file in this terraform version??

Below the one of the content tf file. 75 line is from "group" to "Manager","")

resource "google_compute_backend_service" "gke" {
  name          = "gke-demo-backend-gke"
  port_name     = "port-test"
  protocol      = "HTTP"
  timeout_sec   = 10
  enable_cdn    = false
  backend {
    group = replace(element(google_container_cluster.default.instance_group_urls, 1), "Manager","")
 }
  health_checks = [google_compute_http_health_check.default.self_link]
}

Your cooperation would be highly appreciated!!

How I modify the file in this terraform version??

google-cloud-platform

terraform

terraform-provider-gcp

infrastructure-as-code

0 Answers

Your Answer

Accepted video resources