Skip to content

Commit 4bd810a

Browse files
Fix: DEBUG_MODE added to prod environment (#1948)
1 parent 5edbc7e commit 4bd810a

1 file changed

Lines changed: 15 additions & 10 deletions

File tree

scripts/gcp-oidc/terraform/main.tf

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -102,16 +102,21 @@ resource "google_compute_instance_template" "uid_operator" {
102102
source_image = data.google_compute_image.confidential_space_image.self_link
103103
}
104104

105-
metadata = {
106-
tee-image-reference = var.uid_operator_image
107-
tee-container-log-redirect = true
108-
tee-restart-policy = "Never"
109-
tee-env-DEBUG_MODE = var.debug_mode
110-
tee-env-DEPLOYMENT_ENVIRONMENT = var.uid_deployment_env
111-
tee-env-API_TOKEN_SECRET_NAME = module.secret-manager.secret_versions[0]
112-
tee-env-CORE_BASE_URL = var.uid_deployment_env == "integ" ? "https://core-integ.uidapi.com" : "https://core-prod.uidapi.com"
113-
tee-env-OPTOUT_BASE_URL = var.uid_deployment_env == "integ" ? "https://optout-integ.uidapi.com" : "https://optout-prod.uidapi.com"
114-
}
105+
metadata = merge(
106+
{
107+
tee-image-reference = var.uid_operator_image
108+
tee-container-log-redirect = true
109+
tee-restart-policy = "Never"
110+
tee-env-DEPLOYMENT_ENVIRONMENT = var.uid_deployment_env
111+
tee-env-API_TOKEN_SECRET_NAME = var.uid_operator_key_secret_name
112+
tee-env-CORE_BASE_URL = var.uid_deployment_env == "integ" ? "https://core-integ.uidapi.com" : "https://core-prod.uidapi.com"
113+
tee-env-OPTOUT_BASE_URL = var.uid_deployment_env == "integ" ? "https://optout-integ.uidapi.com" : "https://optout-prod.uidapi.com"
114+
},
115+
var.uid_deployment_env != "prod" ? {
116+
tee-env-DEBUG_MODE = var.debug_mode
117+
} : {}
118+
)
119+
115120

116121
network_interface {
117122
network = google_compute_network.default.name

0 commit comments

Comments
 (0)