Skip to content

Commit

Permalink
Update cloud-cdn.tf
Browse files Browse the repository at this point in the history
  • Loading branch information
kjlippold authored Oct 14, 2024
1 parent 8c395fc commit 460feb1
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions terraform/gcp/cloud-cdn.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ resource "google_compute_backend_service" "hydroserver_backend" {
group = google_compute_region_backend_service.hydroserver_service.self_link
}

# Enable Cloud CDN for the backend service
enable_cdn = true

# Configure caching
cdn_policy {
cache_mode = "CACHE_ALL_STATIC"
default_ttl = 3600
Expand All @@ -22,3 +20,13 @@ resource "google_compute_backend_service" "hydroserver_backend" {
signed_url_cache_mode = "USE_CACHED"
}
}

resource "google_compute_region_backend_service" "hydroserver_service" {
name = "hydroserver-service-backend"
port_name = "http"
protocol = "HTTP"

backend {
group = google_cloud_run_service.hydroserver_api.id
}
}

0 comments on commit 460feb1

Please sign in to comment.