Skip to content

Commit

Permalink
feat: implement firewall priority in iap-tunneling module
Browse files Browse the repository at this point in the history
  • Loading branch information
mwielgosz-esky committed Oct 21, 2024
1 parent 4ff5591 commit a4e883b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions modules/iap-tunneling/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ the necessary APIs enabled.
| additional\_ports | A list of additional ports/ranges to open access to on the instances from IAP. | `list(string)` | `[]` | no |
| create\_firewall\_rule | If we need to create the firewall rule or not. | `bool` | `true` | no |
| fw\_name\_allow\_ssh\_from\_iap | Firewall rule name for allowing SSH from IAP. | `string` | `"allow-ssh-from-iap-to-tunnel"` | no |
| fw\_priority | Firewall rule priority for allowing SSH from IAP. | `number` | `null` | no |
| host\_project | The network host project ID. | `string` | `""` | no |
| instances | Names and zones of the instances to allow SSH from IAP. | <pre>list(object({<br> name = string<br> zone = string<br> }))</pre> | n/a | yes |
| members | List of IAM resources to allow using the IAP tunnel. | `list(string)` | n/a | yes |
Expand Down
1 change: 1 addition & 0 deletions modules/iap-tunneling/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ resource "google_compute_firewall" "allow_from_iap_to_instances" {

target_service_accounts = length(var.service_accounts) > 0 ? var.service_accounts : null
target_tags = length(var.network_tags) > 0 ? var.network_tags : null
priority = var.fw_priority
}

resource "google_iap_tunnel_instance_iam_binding" "enable_iap" {
Expand Down
6 changes: 6 additions & 0 deletions modules/iap-tunneling/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ variable "fw_name_allow_ssh_from_iap" {
default = "allow-ssh-from-iap-to-tunnel"
}

variable "fw_priority" {
description = "Firewall rule priority for allowing SSH from IAP."
type = number
default = null
}

variable "network" {
description = "Self link of the network to attach the firewall to."
type = string
Expand Down

0 comments on commit a4e883b

Please sign in to comment.