fix default tagging for cloud run

This commit is contained in:
41666 2020-12-07 22:49:54 -05:00
parent 22b15ec16a
commit afdf331070
2 changed files with 6 additions and 2 deletions

View file

@ -16,7 +16,7 @@ variable "ui_regions" {
variable "ui_tag" { variable "ui_tag" {
type = string type = string
description = "Specific tag to deploy" description = "Specific tag to deploy"
default = ":main" default = ""
} }
variable "bot_client_id" { variable "bot_client_id" {

View file

@ -1,3 +1,7 @@
locals {
uiTag = var.ui_tag == "" ? ":${var.environment_tag}" : var.ui_tag
}
resource "google_cloud_run_service" "web" { resource "google_cloud_run_service" "web" {
for_each = toset(var.ui_regions) for_each = toset(var.ui_regions)
@ -7,7 +11,7 @@ resource "google_cloud_run_service" "web" {
template { template {
spec { spec {
containers { containers {
image = "${local.artifactBaseMap[each.key]}/ui${var.ui_tag}" image = "${local.artifactBaseMap[each.key]}/ui${local.uiTag}"
env { env {
name = "API_PUBLIC_URI" name = "API_PUBLIC_URI"