Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

google_compute_global_forwarding_rule create fails, if targeting PSC and using labels #20873

Open
wiktorn opened this issue Jan 10, 2025 · 0 comments
Labels

Comments

@wiktorn
Copy link

wiktorn commented Jan 10, 2025

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 a user, that user is claiming responsibility for the issue.
  • Customers working with a Google Technical Account Manager or Customer Engineer can ask them to reach out internally to expedite investigation and resolution of this issue.

Terraform Version & Provider Version(s)

$ terraform version
Terraform v1.10.2
on linux_amd64

  • provider registry.terraform.io/hashicorp/google v6.14.0
  • provider registry.terraform.io/hashicorp/google-beta v6.14.0

Affected Resource(s)

google_compute_global_forwarding_rule

Terraform Configuration

resource "google_compute_global_address" "default" {
  project       = var.project_id
  name          = "global-psconnect-ip"
  address_type  = "INTERNAL"
  purpose       = "PRIVATE_SERVICE_CONNECT"
  network       = var.vpc.self_link
  address       = "100.100.100.106"
}

resource "google_compute_global_forwarding_rule" "default" {
  project       = var.project_id
  name          = "globalrule"
  target        = "all-apis"
  network       = var.vpc.self_link
  ip_address    = google_compute_global_address.default.id
  load_balancing_scheme = ""
  labels = {
    foo = "bar"
  }
}

Debug Output

https://gist.github.com/wiktorn/9a006c00387c2a831b15440910cd1d4f

Expected Behavior

No response

Actual Behavior

google_compute_global_forwarding_rule.default: Creating...
╷
│ Error: Error creating GlobalForwardingRule: googleapi: Error 400: Invalid value for field 'resource.labels': ''. Invalid field set in Private Service Connect Forwarding Rule. This field should not be set., invalid
│ 
│   with google_compute_global_forwarding_rule.default,
│   on main.tf line 10, in resource "google_compute_global_forwarding_rule" "default":
│   10: resource "google_compute_global_forwarding_rule" "default" {
│ 
╵

Steps to reproduce

  1. terraform apply

Important Factoids

No response

References

Similar issue was fixed for google_compute_forwarding_rule in #18984 (see also #17334).

For global forwarding rule, additional conditions needs to be added to accomodate for Global APIs - all-apis and vpc-sc targets

@wiktorn wiktorn added the bug label Jan 10, 2025
@github-actions github-actions bot added forward/review In review; remove label to forward service/compute-l7-load-balancer labels Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant