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 a488e3c commit 9f660e7
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion terraform/gcp/cloud-cdn.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
# -------------------------------------------------- #
# Google Cloud CDN Configuration for Cloud Run #
# Google Cloud CDN Configuration for Cloud Run #
# -------------------------------------------------- #

resource "google_compute_global_address" "hydroserver_lb_ip" {
name = "hydroserver-lb-ip-${var.instance}"
}


resource "google_compute_backend_service" "hydroserver_backend" {
name = "hydroserver-backend-${var.instance}"
load_balancing_scheme = "EXTERNAL"
Expand All @@ -23,3 +28,25 @@ resource "google_compute_backend_service" "hydroserver_backend" {
}
}
}

resource "google_compute_url_map" "hydroserver_url_map" {
name = "hydroserver-url-map-${var.instance}"
default_service = google_compute_backend_service.hydroserver_backend.id
}

resource "google_compute_target_http_proxy" "hydroserver_http_proxy" {
name = "hydroserver-http-proxy-${var.instance}"
url_map = google_compute_url_map.hydroserver_url_map.id
}

resource "google_compute_global_forwarding_rule" "hydroserver_forwarding_rule" {
name = "hydroserver-forwarding-rule-${var.instance}"
target = google_compute_target_http_proxy.hydroserver_http_proxy.id
port_range = "80"
load_balancing_scheme = "EXTERNAL"
ip_address = google_compute_global_address.hydroserver_ip.address
}

resource "google_compute_global_address" "hydroserver_ip" {
name = "hydroserver-ip-${var.instance}"
}

0 comments on commit 9f660e7

Please sign in to comment.