File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -132,11 +132,13 @@ resource "aws_security_group_rule" "redis_ingress_cidr_blocks" {
132132}
133133
134134resource "aws_security_group_rule" "redis_egress" {
135+ count = length (var. egress_cidr_blocks ) != 0 ? 1 : 0
136+
135137 type = " egress"
136138 from_port = 0
137139 to_port = 0
138140 protocol = " -1"
139- cidr_blocks = [ " 0.0.0.0/0 " ]
141+ cidr_blocks = var . egress_cidr_blocks
140142 security_group_id = aws_security_group. redis . id
141143}
142144
Original file line number Diff line number Diff line change @@ -36,6 +36,12 @@ variable "ingress_cidr_blocks" {
3636 default = []
3737}
3838
39+ variable "egress_cidr_blocks" {
40+ type = list (string )
41+ description = " List of Egress CIDR blocks."
42+ default = [" 0.0.0.0/0" ]
43+ }
44+
3945variable "ingress_self" {
4046 type = bool
4147 description = " Specify whether the security group itself will be added as a source to the ingress rule."
You can’t perform that action at this time.
0 commit comments