-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathefs.tf
35 lines (30 loc) · 753 Bytes
/
efs.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
resource "aws_security_group" "remotex-sg-efs" {
name = "remotex-sg-efs"
vpc_id = aws_vpc.remotex-vpc.id
ingress {
from_port = 2049
protocol = "tcp"
to_port = 2049
cidr_blocks = [aws_subnet.remotex-pub-sub.cidr_block]
}
egress {
from_port = 0
protocol = "-1"
to_port = 0
cidr_blocks = ["0.0.0.0/0"]
}
tags = {
Name = "remotex-sg-efs"
}
}
resource "aws_efs_file_system" "remotex-efs" {
creation_token = "remotex-efs"
tags = {
Name = "remotex-efs"
}
}
resource "aws_efs_mount_target" "remotex-efs-mt" {
file_system_id = aws_efs_file_system.remotex-efs.id
subnet_id = aws_subnet.remotex-pub-sub.id
security_groups = [aws_security_group.remotex-sg-efs.id]
}