On google_compute_backend_service when CDN policy is changed from CACHE_ALL_STATIC to FORCE_CACHE_ALL fails to apply due to max_ttl configuration #20661
Labels
forward/linked
persistent-bug
Hard to diagnose or long lived bugs for which resolutions are more like feature work than bug work
plugin-framework
Issues related to the migration to PF
service/compute-l7-load-balancer
Community Note
Terraform Version & Provider Version(s)
Terraform v1.9.8
on darwin_arm64
Affected Resource(s)
google_compute_backend_service
Terraform Configuration
Debug Output
Error: Error updating BackendService "projects/[REDACTED]/global/backendServices/backend-svc-secondary-page-builder-fe-api-liv-golf-prd-ue4": googleapi: Error 400: Invalid value for field 'resource.cdnPolicy.maxTtl': '600'. max_ttl must be specified with CACHE_ALL_STATIC cache_mode only., invalid
│
│ with module.secondary_backend_service["secondary-page-builder-fe-api"].google_compute_backend_service.this,
│ on ../modules/network/backend_service/resource-backend_service.tf line 1, in resource "google_compute_backend_service" "this":
│ 1: resource "google_compute_backend_service" "this" {
│
╵
╷
Error: Error updating BackendService "projects/[REDACTED]/global/backendServices/backend-svc-primary-page-builder-fe-api-liv-golf-prd-ue1": googleapi: Error 400: Invalid value for field 'resource.cdnPolicy.maxTtl': '600'. max_ttl must be specified with CACHE_ALL_STATIC cache_mode only., invalid
│
│ with module.primary_backend_service["primary-page-builder-fe-api"].google_compute_backend_service.this,
│ on ../modules/network/backend_service/resource-backend_service.tf line 1, in resource "google_compute_backend_service" "this":
│ 1: resource "google_compute_backend_service" "this" {
Expected Behavior
Terraform should be able to update changes on CDN policy for backend service
Actual Behavior
Fails stating that a max_ttl value has been provided (600s) but as you can see in the configuration the value is set to null if cache_mode is not "CACHE_ALL_STATIC"
Steps to reproduce
terraform apply
Important Factoids
No response
References
See this issue #10560 as it is somewhat similar in behavior
b/383901730
The text was updated successfully, but these errors were encountered: