Skip to content

Commit 4c84d22

Browse files
feat: implement firewall priority in iap-tunneling module (#216)
1 parent 4ff5591 commit 4c84d22

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

modules/iap-tunneling/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ the necessary APIs enabled.
8989
| additional\_ports | A list of additional ports/ranges to open access to on the instances from IAP. | `list(string)` | `[]` | no |
9090
| create\_firewall\_rule | If we need to create the firewall rule or not. | `bool` | `true` | no |
9191
| fw\_name\_allow\_ssh\_from\_iap | Firewall rule name for allowing SSH from IAP. | `string` | `"allow-ssh-from-iap-to-tunnel"` | no |
92+
| fw\_priority | Firewall rule priority for allowing SSH from IAP. | `number` | `null` | no |
9293
| host\_project | The network host project ID. | `string` | `""` | no |
9394
| 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 |
9495
| members | List of IAM resources to allow using the IAP tunnel. | `list(string)` | n/a | yes |

modules/iap-tunneling/main.tf

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ resource "google_compute_firewall" "allow_from_iap_to_instances" {
3131

3232
target_service_accounts = length(var.service_accounts) > 0 ? var.service_accounts : null
3333
target_tags = length(var.network_tags) > 0 ? var.network_tags : null
34+
priority = var.fw_priority
3435
}
3536

3637
resource "google_iap_tunnel_instance_iam_binding" "enable_iap" {

modules/iap-tunneling/variables.tf

+6
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ variable "fw_name_allow_ssh_from_iap" {
3131
default = "allow-ssh-from-iap-to-tunnel"
3232
}
3333

34+
variable "fw_priority" {
35+
description = "Firewall rule priority for allowing SSH from IAP."
36+
type = number
37+
default = null
38+
}
39+
3440
variable "network" {
3541
description = "Self link of the network to attach the firewall to."
3642
type = string

0 commit comments

Comments
 (0)