Skip to content

Commit 5785032

Browse files
added eggress
1 parent 7014078 commit 5785032

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ resource "aws_security_group" "default" {
1010

1111
resource "aws_security_group_rule" "egress" {
1212
count = module.this.enabled && var.use_existing_security_groups == false ? 1 : 0
13-
description = "Allow all egress traffic"
13+
description = "Allow outbound traffic from existing cidr blocks"
1414
from_port = 0
1515
to_port = 0
1616
protocol = "-1"
17-
cidr_blocks = ["0.0.0.0/0"]
17+
cidr_blocks = var.egress_cidr_blocks
1818
security_group_id = join("", aws_security_group.default.*.id)
1919
type = "egress"
2020
}

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,3 +210,9 @@ variable "cloudwatch_metric_alarms_enabled" {
210210
description = "Boolean flag to enable/disable CloudWatch metrics alarms"
211211
default = false
212212
}
213+
214+
variable egress_cidr_blocks {
215+
type = list
216+
default = ["0.0.0.0/0"]
217+
description = "Outbound traffic address"
218+
}

0 commit comments

Comments
 (0)