-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsecurity_group.tf
47 lines (44 loc) · 939 Bytes
/
security_group.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
resource "aws_security_group" "example-lambda-vpc" {
name = "example-lambda-vpc-sg"
vpc_id = aws_vpc.example-vpc.id
ingress {
from_port = 2049
protocol = "tcp"
to_port = 2049
cidr_blocks = ["0.0.0.0/0"]
}
egress {
from_port = 2049
protocol = "tcp"
to_port = 2049
cidr_blocks = ["0.0.0.0/0"]
}
}
resource "aws_security_group" "example-efs" {
name = "example-efs-sg"
vpc_id = aws_vpc.example-vpc.id
ingress {
from_port = 2049
protocol = "tcp"
to_port = 2049
security_groups = [
aws_security_group.example-lambda-vpc.id
]
}
ingress {
from_port = 2049
protocol = "udp"
to_port = 2049
security_groups = [
aws_security_group.example-lambda-vpc.id
]
}
egress {
from_port = 2049
protocol = "tcp"
to_port = 2049
cidr_blocks = [
"0.0.0.0/0"
]
}
}