diff --git a/examples/naming_overrides/main.tf b/examples/naming_overrides/main.tf index c76db80..bfc0832 100644 --- a/examples/naming_overrides/main.tf +++ b/examples/naming_overrides/main.tf @@ -13,14 +13,16 @@ * # The module comes with a default config that you can override. * # Check out the config reference for more info. * config = { -* airbyte_vm_name = "airbyte" -* airbyte_sa_name = "airbyte" -* vpc_name = "airbyte-vpc" -* subnet_name = "airbyte-subnet" -* router_name = "airbyte-router" -* external_ip_name = "airbyte-ip" -* nat_name = "airbyte-nat" -* internet_route_name = "airbyte-internet-route" +* airbyte_vm_name = "airbyte" +* airbyte_sa_name = "airbyte" +* vpc_name = "airbyte-vpc" +* subnet_name = "airbyte-subnet" +* router_name = "airbyte-router" +* external_ip_name = "airbyte-ip" +* nat_name = "airbyte-nat" +* internet_route_name = "airbyte-internet-route" +* internal_traffic_firewall_name = "allow-internal-traffic" +* ssh_from_iap_firewall_name = "allow-ssh-from-iap" * } * } * ``` @@ -37,13 +39,15 @@ module "airbyte" { # The module comes with a default config that you can override. # Check out the config reference for more info. config = { - airbyte_vm_name = "airbyte" - airbyte_sa_name = "airbyte" - vpc_name = "airbyte-vpc" - subnet_name = "airbyte-subnet" - router_name = "airbyte-router" - external_ip_name = "airbyte-ip" - nat_name = "airbyte-nat" - internet_route_name = "airbyte-internet-route" + airbyte_vm_name = "airbyte" + airbyte_sa_name = "airbyte" + vpc_name = "airbyte-vpc" + subnet_name = "airbyte-subnet" + router_name = "airbyte-router" + external_ip_name = "airbyte-ip" + nat_name = "airbyte-nat" + internet_route_name = "airbyte-internet-route" + internal_traffic_firewall_name = "allow-internal-traffic" + ssh_from_iap_firewall_name = "allow-ssh-from-iap" } } diff --git a/network.tf b/network.tf index c8dd3a1..dcf97f3 100644 --- a/network.tf +++ b/network.tf @@ -54,7 +54,7 @@ resource "google_compute_route" "internet_route" { resource "google_compute_firewall" "allow_ssh_from_iap" { project = var.project_id - name = "allow-ssh-from-iap" + name = var.config.ssh_from_iap_firewall_name description = "Allow SSH from IAP" direction = "INGRESS" network = google_compute_network.airbyte_vpc.id @@ -69,7 +69,7 @@ resource "google_compute_firewall" "allow_ssh_from_iap" { resource "google_compute_firewall" "allow_internal_traffic" { project = var.project_id - name = "allow-internal-traffic" + name = var.config.internal_traffic_firewall_name description = "Allow internal traffic within VPC" direction = "INGRESS" network = google_compute_network.airbyte_vpc.id diff --git a/variables.tf b/variables.tf index 58bc3b3..d8c4523 100644 --- a/variables.tf +++ b/variables.tf @@ -30,14 +30,16 @@ variable "config" { airbyte_sa_name = optional(string, "airbyte") labels = optional(map(string), {}) - vpc_name = optional(string, "airbyte-vpc") - subnet_name = optional(string, "airbyte-subnet") - ip_cidr_range = optional(string, "10.0.1.0/24") - router_name = optional(string, "airbyte-router") - external_ip_name = optional(string, "airbyte-ip") - nat_name = optional(string, "airbyte-nat") - internet_route_name = optional(string, "airbyte-internet-route") - network_tags = optional(list(string), []) + vpc_name = optional(string, "airbyte-vpc") + subnet_name = optional(string, "airbyte-subnet") + ip_cidr_range = optional(string, "10.0.1.0/24") + router_name = optional(string, "airbyte-router") + external_ip_name = optional(string, "airbyte-ip") + nat_name = optional(string, "airbyte-nat") + internet_route_name = optional(string, "airbyte-internet-route") + internal_traffic_firewall_name = optional(string, "allow-internal-traffic") + ssh_from_iap_firewall_name = optional(string, "allow-ssh-from-iap") + network_tags = optional(list(string), []) }) default = {} }