Skip to content

Commit

Permalink
added variable for rule protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
maxi418 committed Jan 10, 2024
1 parent 644b91b commit f87537a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion modules/ionos-k8s-natgateway/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ resource "ionoscloud_natgateway_rule" "natgateway_rule" {
natgateway_id = ionoscloud_natgateway.natgateway.id
name = var.natgateway_rule_name
type = "SNAT"
protocol = "TCP"
protocol = var.natgateway_rule_protocol
source_subnet = local.gateway_subnet
public_ip = var.create_ipblock ? ionoscloud_ipblock.natgateway[0].ips[0] : var.natgateway_public_ips[0]
}
Expand Down
8 changes: 7 additions & 1 deletion modules/ionos-k8s-natgateway/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ variable "lan_id" {
}

variable "natgateway_host_num" {
description = "The number to be set in the last ip block. (Default: 8)"
description = "The number to be set in the last ip block. Default: 8."
type = number
default = 8
}
Expand All @@ -35,6 +35,12 @@ variable "natgateway_rule_name" {
type = string
}

variable "natgateway_rule_protocol" {
description = "Specifies the protocol of the NAT gateway rule. Default: ALL."
type = string
default = "ALL"
}

variable "create_ipblock" {
description = "Specifies whether an ipblock should be created. Default: false."
type = bool
Expand Down

0 comments on commit f87537a

Please sign in to comment.