Skip to content

Commit 7167461

Browse files
authored
Allow outbound DNS requests from Lambda SG (#3)
So that we can resolve DNS for the ES cluster.
1 parent e7633d0 commit 7167461

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

main.tf

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,26 @@ resource "aws_security_group" "default" {
121121
tags = "${module.label.tags}"
122122
}
123123

124+
resource "aws_security_group_rule" "udp_dns_egress_from_lambda" {
125+
description = "Allow outbound UDP traffic from Lambda Elasticsearch cleanup to DNS"
126+
type = "egress"
127+
from_port = 53
128+
to_port = 53
129+
protocol = "udp"
130+
cidr_blocks = ["0.0.0.0/0"]
131+
security_group_id = "${aws_security_group.default.id}"
132+
}
133+
134+
resource "aws_security_group_rule" "tcp_dns_egress_from_lambda" {
135+
description = "Allow outbound TCP traffic from Lambda Elasticsearch cleanup to DNS"
136+
type = "egress"
137+
from_port = 53
138+
to_port = 53
139+
protocol = "tcp"
140+
cidr_blocks = ["0.0.0.0/0"]
141+
security_group_id = "${aws_security_group.default.id}"
142+
}
143+
124144
resource "aws_security_group_rule" "egress_from_lambda_to_es_cluster" {
125145
description = "Allow outbound traffic from Lambda Elasticsearch cleanup SG to Elasticsearch SG"
126146
type = "egress"

0 commit comments

Comments
 (0)