FAQ | This is a LIVE service | Changelog

Skip to content
Snippets Groups Projects
Commit 60946f5c authored by Monty Dawson's avatar Monty Dawson :coffee:
Browse files

Refactor enabling beta launch stage to local with variable override

parent ac6ccb6f
No related branches found
No related tags found
1 merge request!16Use Google Beta provider to allow for min-scale option
Pipeline #59075 passed
......@@ -6,4 +6,10 @@ locals {
# Should a DNS domain mapping be created?
domain_mapping_present = var.dns_name != ""
# Do we need to enable the 'beta' launch stage - only required if certain beta
# functionality is being used, or if `enable_beta_launch_stage` is set downstream
enable_beta_launch_stage = (
var.enable_beta_launch_stage || var.allowed_ingress != "all" || var.min_scale > 0
)
}
......@@ -38,7 +38,7 @@ resource "google_cloud_run_service" "webapp" {
},
# Add the beta launch stage if required.
var.allowed_ingress != "all" || var.min_scale > 0 ? {
local.enable_beta_launch_stage ? {
# Required to be able to set ingress type.
"run.googleapis.com/launch-stage" : "BETA",
} : {},
......
......@@ -163,3 +163,8 @@ variable "template_annotations" {
template.
EOL
}
variable "enable_beta_launch_stage" {
default = false
description = "Force use of the 'BETA' launch stage for the service."
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment