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_region_backend_service should not have enable_cdn argument, as Regional Load Balancers don't support Cloud CDN #20919

Open
mikewirth opened this issue Jan 15, 2025 · 0 comments
Assignees
Labels

Comments

@mikewirth
Copy link

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 v1.9.8
on darwin_arm64

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

Affected Resource(s)

google_compute_region_backend_service

Terraform Configuration

resource "google_compute_region_backend_service" "test" {
  name                  = "test"
  region                = "europe-west1"
  protocol              = "HTTP"
  port_name             = "http"
  load_balancing_scheme = "EXTERNAL_MANAGED"
  timeout_sec           = 30

  enable_cdn = true

  backend {
    group           = google_compute_region_network_endpoint_group.test_neg.id
    capacity_scaler = 1.0
  }
}

Debug Output

Error: Error updating RegionBackendService "projects/myproject/regions/europe-west1/backendServices/test": googleapi: Error 400: Invalid value for field 'resource.enableCDN': 'true'. Enable CDN is not allowed for regional EXTERNAL_MANAGED backend service with HTTP(S) protocol., invalid

Expected Behavior

The arguments enable_cdn and cdn_policy should not be present on google_compute_region_backend_service, as the Regional External Application Load Balancer does not support Cloud CDN.

Quote from the documentation:

Cloud CDN is supported with the global external Application Load Balancer and the classic Application Load Balancer.

Actual Behavior

The GCP API returns an error 400:

Error: Error updating RegionBackendService "projects/myproject/regions/europe-west1/backendServices/test": googleapi: Error 400: Invalid value for field 'resource.enableCDN': 'true'. Enable CDN is not allowed for regional EXTERNAL_MANAGED backend service with HTTP(S) protocol., invalid

Steps to reproduce

  1. terraform apply

Important Factoids

No response

References

https://cloud.google.com/load-balancing/docs/load-balancing-overview
https://cloud.google.com/compute/docs/reference/rest/v1/regionBackendServices: The API documentation for the regionBackendService lists the parameter enableCDN, but also says:

If true, enables Cloud CDN for the backend service of a global external Application Load Balancer.

@mikewirth mikewirth added the bug label Jan 15, 2025
@github-actions github-actions bot added forward/review In review; remove label to forward service/compute-l7-load-balancer labels Jan 15, 2025
@ggtisc ggtisc self-assigned this Jan 16, 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

2 participants