-
Notifications
You must be signed in to change notification settings - Fork 0
/
efs.tf
34 lines (31 loc) · 823 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
resource "aws_efs_file_system" "eh_efs" {
creation_token = "${var.owner}_efs"
}
resource "aws_efs_file_system_policy" "policy" {
file_system_id = aws_efs_file_system.eh_efs.id
policy = <<EOF
{
"Version": "2012-10-17",
"Id": "Policy",
"Statement": [
{
"Sid": "Statement",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
"Action": [
"elasticfilesystem:ClientRootAccess",
"elasticfilesystem:ClientMount",
"elasticfilesystem:ClientWrite"
]
}
]
}
EOF
}
resource "aws_efs_mount_target" "efs_target" {
count = length(local.private_subnet_ids)
file_system_id = aws_efs_file_system.eh_efs.id
subnet_id = local.private_subnet_ids[count.index]
}