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 v0.13.0
+ provider registry.terraform.io/-/google v3.35.0
+ provider registry.terraform.io/-/google-beta v3.35.0
+ provider registry.terraform.io/-/null v2.1.2
+ provider registry.terraform.io/-/random v2.3.0
+ provider registry.terraform.io/hashicorp/google v3.35.0
+ provider registry.terraform.io/hashicorp/google-beta v3.35.0
+ provider registry.terraform.io/hashicorp/null v2.1.2
+ provider registry.terraform.io/hashicorp/random v2.3.0
This is a simplified config that triggers the bug. A full example can be found at https://github.com/google/exposure-notifications-verification-server/pull/248
resource "google_compute_region_network_endpoint_group" "cloudrun_neg" {
provider = google-beta
name = "cloudrun-neg"
network_endpoint_type = "SERVERLESS"
region = "us-central1"
cloud_run {
service = google_cloud_run_service.cloudrun_neg.name
}
}
resource "google_cloud_run_service" "cloudrun_neg" {
provider = google-beta
name = "cloudrun-neg"
location = "us-central1"
template {
spec {
containers {
image = "gcr.io/cloudrun/hello"
}
}
}
traffic {
percent = 100
latest_revision = true
}
}
resource "google_compute_backend_service" "example" {
provider = google-beta
name = "example"
project = var.project
backend {
group = google_compute_region_network_endpoint_group.cloudrun_neg.id
}
}
https://gist.github.com/icco/0e29297c1cb2e8e47b9c0759c1f84c87
Error: Error creating BackendService: googleapi: Error 400: Invalid value for field 'resource.backends[0].maxUtilization': '0.8'. Max utilization is not supported for Serverless network endpoint groups., invalid
on main.tf line 78, in resource "google_compute_backend_service" "example":
78: resource "google_compute_backend_service" "example" {
terraform applyWith the new serverless endpoint type, the default values we send are no longer valid.
Ah yeah, I made this work specifically for global NEGs based on inferring type from their URL. A similar check will be needed for regional NEGs
I attempted setting max_utilization (which is documented as being optional) to null (from its default value of 0.8), but to no avail.
This is still happening in 3.36 @slevenick
@icco it looks like this was merged just after the 3.36 release was cut. It will be in the 3.37 release expected next monday
Is there any way I can test it or use it before then? I ask because we have a big release next week, and if there are bugs I'd love to not wait another week.
Yes! You can build the provider from source and use it locally.
Directions are here: https://github.com/hashicorp/terraform-provider-google#building-the-provider
and here: https://github.com/hashicorp/terraform-provider-google/blob/master/.github/CONTRIBUTING.md#running-a-local-copy-of-the-provider
Small note on this: while it works, the maxUtilization etc values are still shown in the terraform plan output.
Yeah, that's due to maxUtilization having a default value. It's tricky to remove without causing a breaking change, so I went with leaving it in the plan but stripping it from the request for serverless NEGs
I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues.
If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!
Most helpful comment
I attempted setting max_utilization (which is documented as being optional) to null (from its default value of 0.8), but to no avail.