Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hotfix: add variables for the naming of the firewall rules #1

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
36 changes: 20 additions & 16 deletions examples/naming_overrides/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
* }
* }
* ```
Expand All @@ -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"
}
}
4 changes: 2 additions & 2 deletions network.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
18 changes: 10 additions & 8 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}
}