adjust tf to support digest tags

This commit is contained in:
41666 2020-12-06 08:46:16 -05:00
parent 432922dd21
commit c25943dfa0
4 changed files with 8 additions and 3 deletions

View file

@ -1 +1,2 @@
node_modules
node_modules
.next

View file

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

View file

@ -7,7 +7,7 @@ resource "google_cloud_run_service" "web" {
template {
spec {
containers {
image = "us-docker.pkg.dev/roleypoly/roleypoly/ui:${var.ui_tag}"
image = "us-docker.pkg.dev/roleypoly/roleypoly/ui${var.ui_tag}"
env {
name = "API_PUBLIC_URI"

View file

@ -65,6 +65,10 @@ resource "google_compute_region_network_endpoint_group" "web_lb" {
provider = google-beta
for_each = toset(var.ui_regions)
lifecycle {
create_before_destroy = true
}
name = "lb-fr-neg-${each.key}-${var.environment_tag}"
region = google_cloud_run_service.web[each.key].location
network_endpoint_type = "SERVERLESS"