Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions deployment/modules/gcp/loadbalancer/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ terraform {
module "gce-lb-http" {
source = "terraform-google-modules/lb-http/google"
version = "~> 12.0"
name = "witness-lb-http"
name = "witness-${var.env}-lb-http"
project = var.project_id
load_balancing_scheme = "EXTERNAL"
ssl = true
Expand Down Expand Up @@ -67,7 +67,7 @@ resource "google_compute_region_network_endpoint_group" "serverless_neg" {
for_each = var.witnesses

#provider = google-beta
name = "serverless-neg-${each.key}"
name = "serverless-neg-${var.env}-${each.key}"
network_endpoint_type = "SERVERLESS"
region = each.value.region
cloud_run {
Expand All @@ -77,7 +77,7 @@ resource "google_compute_region_network_endpoint_group" "serverless_neg" {


resource "google_compute_url_map" "url_map" {
name = "witness-url-map"
name = "witness-${var.env}-url-map"
description = "URL map of witnesses"

# Redirect requests to invalid endpoints to the witnesses page on transparency.dev
Expand All @@ -104,7 +104,7 @@ resource "google_compute_url_map" "url_map" {
iterator = each

content {
name = "${each.key}-path-matcher"
name = "${var.env}-${each.key}-path-matcher"

# Redirect requests to invalid endpoints to the witnesses page on t.dev
default_url_redirect {
Expand Down Expand Up @@ -133,7 +133,7 @@ module "cloud_armor" {

count = var.enable_cloud_armor ? 1 : 0
project_id = var.project_id
name = "witness-security-policy"
name = "witness-${var.env}-security-policy"
description = "Witness LB Security Policy"
default_rule_action = "allow"
type = "CLOUD_ARMOR"
Expand Down
5 changes: 5 additions & 0 deletions deployment/modules/gcp/loadbalancer/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ variable "project_id" {
type = string
}

variable "env" {
description = "Environment name to deploy to"
type = string
}

variable "domain" {
description = "Domain mapped to the load balancer."
type = string
Expand Down
Loading