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" {
132
132
}
133
133
134
134
resource "aws_security_group_rule" "redis_egress" {
135
+ count = length (var. egress_cidr_blocks ) != 0 ? 1 : 0
136
+
135
137
type = " egress"
136
138
from_port = 0
137
139
to_port = 0
138
140
protocol = " -1"
139
- cidr_blocks = [ " 0.0.0.0/0 " ]
141
+ cidr_blocks = var . egress_cidr_blocks
140
142
security_group_id = aws_security_group. redis . id
141
143
}
142
144
Original file line number Diff line number Diff line change @@ -36,6 +36,12 @@ variable "ingress_cidr_blocks" {
36
36
default = []
37
37
}
38
38
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
+
39
45
variable "ingress_self" {
40
46
type = bool
41
47
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