basic terraform definition for gcp

This commit is contained in:
miampf 2024-04-12 14:35:50 +02:00
parent f74f9e9ec0
commit 1e90594059
No known key found for this signature in database
GPG Key ID: EF039364B5B6886C

View File

@ -183,7 +183,7 @@ module "instance_group" {
kube_env = local.kube_env
debug = var.debug
named_ports = each.value.role == "control-plane" ? local.control_plane_named_ports : []
labels = local.labels
labels = merge(var.additional_labels, local.labels)
init_secret_hash = local.init_secret_hash
custom_endpoint = var.custom_endpoint
cc_technology = var.cc_technology
@ -196,11 +196,13 @@ resource "google_compute_address" "loadbalancer_ip_internal" {
subnetwork = google_compute_subnetwork.ilb_subnet[0].id
purpose = "SHARED_LOADBALANCER_VIP"
address_type = "INTERNAL"
labels = var.additional_labels
}
resource "google_compute_global_address" "loadbalancer_ip" {
count = var.internal_load_balancer ? 0 : 1
name = local.name
labels = var.additional_labels
}
module "loadbalancer_public" {
@ -213,7 +215,7 @@ module "loadbalancer_public" {
health_check = each.value.health_check
backend_instance_groups = local.control_plane_instance_groups
ip_address = google_compute_global_address.loadbalancer_ip[0].self_link
frontend_labels = merge(local.labels, { constellation-use = each.value.name })
frontend_labels = merge(local.labels, var.additional_labels, { constellation-use = each.value.name })
}
module "loadbalancer_internal" {
@ -225,7 +227,7 @@ module "loadbalancer_internal" {
health_check = each.value.health_check
backend_instance_group = local.control_plane_instance_groups[0]
ip_address = google_compute_address.loadbalancer_ip_internal[0].self_link
frontend_labels = merge(local.labels, { constellation-use = each.value.name })
frontend_labels = merge(local.labels, var.additional_labels, { constellation-use = each.value.name })
region = var.region
network = google_compute_network.vpc_network.id
@ -238,7 +240,7 @@ module "jump_host" {
base_name = local.name
zone = var.zone
subnetwork = google_compute_subnetwork.vpc_subnetwork.id
labels = local.labels
labels = merge(local.labels, var.additional_labels)
lb_internal_ip = google_compute_address.loadbalancer_ip_internal[0].address
ports = [for port in local.control_plane_named_ports : port.port]
}