Skip to content

Commit 386f953

Browse files
authored
fix: use install_id for cdn resource names instead of project_id (#241)
1 parent 70fca17 commit 386f953

3 files changed

Lines changed: 9 additions & 4 deletions

File tree

gcp-gcs-static-site/components/2-tf-cdn.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ branch = "main"
1212
[vars]
1313
bucket_name = "{{.nuon.components.gcs_bucket.outputs.bucket_name}}"
1414
project_id = "{{.nuon.install_stack.outputs.project_id}}"
15+
install_id = "{{.nuon.install.id}}"
1516
domain = "{{.nuon.inputs.inputs.sub_domain}}.{{.nuon.inputs.inputs.domain}}"

gcp-gcs-static-site/src/components/cdn/main.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
resource "google_compute_backend_bucket" "site" {
2-
name = "static-site-backend-${var.project_id}"
2+
name = "static-site-backend-${var.install_id}"
33
bucket_name = var.bucket_name
44
project = var.project_id
55
enable_cdn = true
66
}
77

88
resource "google_compute_url_map" "site" {
9-
name = "static-site-${var.project_id}"
9+
name = "static-site-${var.install_id}"
1010
project = var.project_id
1111
default_service = google_compute_backend_bucket.site.id
1212
}
1313

1414
resource "google_compute_target_http_proxy" "site" {
15-
name = "static-site-proxy-${var.project_id}"
15+
name = "static-site-proxy-${var.install_id}"
1616
project = var.project_id
1717
url_map = google_compute_url_map.site.id
1818
}
1919

2020
resource "google_compute_global_forwarding_rule" "site" {
21-
name = "static-site-fwd-${var.project_id}"
21+
name = "static-site-fwd-${var.install_id}"
2222
project = var.project_id
2323
target = google_compute_target_http_proxy.site.id
2424
port_range = "80"

gcp-gcs-static-site/src/components/cdn/variables.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ variable "project_id" {
66
type = string
77
}
88

9+
variable "install_id" {
10+
type = string
11+
}
12+
913
variable "domain" {
1014
type = string
1115
}

0 commit comments

Comments
 (0)