Skip to content
This repository was archived by the owner on Jul 20, 2024. It is now read-only.

feat: add variable for egress protocol #69

Open
wants to merge 1 commit into
base: master
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
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ resource "aws_security_group_rule" "egress" {
cidr_blocks = ["0.0.0.0/0"]
from_port = 0
to_port = 65535
protocol = "tcp"
protocol = var.egress_protocol
}

resource "aws_security_group_rule" "ingress_any" {
Expand Down
10 changes: 10 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,16 @@ variable "user_data_runcmd" {
default = []
}

variable "egress_protocol" {
description = "Protocol allowed to egress out of the NAT instance"
type = string
default = "tcp"
validation {
condition = var.egress_protocol == "tcp" || var.egress_protocol == "udp" || var.egress_protocol == "all"
error_message = "The egress_protocol must be one of 'tcp', 'udp' or 'all'."
}
}

locals {
// Merge the default tags and user-specified tags.
// User-specified tags take precedence over the default.
Expand Down