hashicorp / terraform-provider-google

Terraform Provider for Google Cloud Platform
https://registry.terraform.io/providers/hashicorp/google/latest/docs
Mozilla Public License 2.0
2.36k stars 1.75k forks source link

google_compute_global_forwarding_rule does not work with default project network tier STANDARD #20514

Open felipou opened 4 days ago

felipou commented 4 days ago

Community Note

Terraform Version & Provider Version(s)

OpenTofu v1.8.6 on

Affected Resource(s)

google_compute_global_forwarding_rule

Terraform Configuration

resource "google_compute_global_forwarding_rule" "default" {
  name                  = "ruletest"
  ip_protocol           = "TCP"
  load_balancing_scheme = "EXTERNAL"
  port_range            = "80"
  target                = google_compute_target_http_proxy.cdn-public.id
  ip_address            = google_compute_address.default.id
}

Debug Output

No response

Expected Behavior

I should be able to create a google_compute_global_forwarding_rule even though my project's default network tier is STANDARD. When it failed, I expected there to be a network_tier attribute (with PREMIUM as the default value) so that it would work.

Actual Behavior

I got the following error message:

│ Error: Error creating GlobalForwardingRule: googleapi: Error 400: STANDARD network tier (the project's default network tier) is not supported: STANDARD network tier is not supported for global forwarding rule., badRequest

And I was not able to set the network_tier manually because this attribute isn't there, so I had to temporarily set the project's default network tier as PREMIUM.

Steps to reproduce

  1. terraform apply

Important Factoids

From what I've seen here in the latest source code version, the attribute network_tier still isn't there: https://github.com/hashicorp/terraform-provider-google/blob/main/google/services/compute/resource_compute_global_forwarding_rule.go

References

No response

b/381438021

ggtisc commented 3 days ago

It is necessary to thoroughly review whether it is mandatory to use a PREMIUM tier for this type of configuration since nothing related appears in the terraform registry