-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathefs.tf
40 lines (33 loc) · 930 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
36
37
38
39
40
resource "aws_efs_file_system" "vpn-server-config" {
performance_mode = "generalPurpose"
tags = {
Name = "vpn-server-config"
}
}
resource "aws_efs_mount_target" "vpn-server-config" {
count = length(var.efs_subnet_ids)
file_system_id = aws_efs_file_system.vpn-server-config.id
subnet_id = var.efs_subnet_ids[count.index]
security_groups = [aws_security_group.vpn-efs.id]
}
resource "aws_security_group" "vpn-efs" {
name = "vpn-server-config-efs"
description = "vpn-server-config-efs"
vpc_id = var.vpc_id
ingress {
from_port = 2049
protocol = "tcp"
to_port = 2049
security_groups = [aws_security_group.vpn-server.id]
description = "Allow traffic from vpn-server to efs"
}
egress {
from_port = 0
protocol = "-1"
to_port = 0
cidr_blocks = ["0.0.0.0/0"]
}
tags = {
Name = "vpn-server-config-efs"
}
}