Skip to content

Commit 45f7369

Browse files
author
janvt
authored
Merge pull request #5 from geekcell/fix/swap-foreach-for-count
fix: switch to count from foreach for mount points
2 parents d06fae0 + 05d05d2 commit 45f7369

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ No outputs.
7373
- resource.aws_efs_file_system.main (main.tf#1)
7474
- resource.aws_efs_file_system_policy.main (main.tf#44)
7575
- resource.aws_efs_mount_target.main (main.tf#37)
76-
- resource.random_uuid.main (main.tf#53)
76+
- resource.random_uuid.main (main.tf#52)
7777
- data source.aws_caller_identity.current (data.tf#1)
7878
- data source.aws_iam_policy_document.main (data.tf#3)
7979

main.tf

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,15 @@ resource "aws_efs_file_system" "main" {
3535
}
3636

3737
resource "aws_efs_mount_target" "main" {
38-
for_each = toset(var.private_subnets)
38+
count = length(var.private_subnets)
3939
file_system_id = aws_efs_file_system.main.id
4040
security_groups = var.security_groups
41-
subnet_id = each.value
41+
subnet_id = var.private_subnets[count.index]
4242
}
4343

4444
resource "aws_efs_file_system_policy" "main" {
4545
file_system_id = aws_efs_file_system.main.id
4646

47-
4847
bypass_policy_lockout_safety_check = var.bypass_policy_lockout_safety_check
4948

5049
policy = data.aws_iam_policy_document.main.json

0 commit comments

Comments
 (0)