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

feat: implement firewall priority in iap-tunneling module #216

Merged
merged 1 commit into from
Oct 29, 2024
Merged
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
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