Skip to content
This repository was archived by the owner on Feb 11, 2020. It is now read-only.

Commit 389ba79

Browse files
mgeerdsenkenoir
authored andcommitted
allow access to EFS mount target from list of SGs (#48)
Changing variable to allow a list of security groups to be used in the ingress rules for the EFS mount targets.
1 parent 4bb9144 commit 389ba79

3 files changed

Lines changed: 7 additions & 8 deletions

File tree

efs/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ AWS Elastic File System module.
55
This module creates:
66
- An EFS filesystem
77
- Mount points for each subnet specified
8-
- Permissions to access the filesystem for the specified security group
8+
- Permissions to access the filesystem for the specified security groups
99

1010

1111
## Usage
@@ -18,8 +18,8 @@ module "my_efs_module" {
1818
vpc_id = "${var.vpc_id}"
1919
subnets = ["${var.my_subnets}"]
2020
21-
# Security group ID for ingress
22-
efs_access_security_group_id = "${var.security_group_id}"
21+
# Security group IDs for ingress
22+
efs_access_security_group_ids = [${var.security_group_ids}"]
2323
}
2424
```
2525

efs/main.tf

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ resource "aws_security_group" "efs_mnt" {
2020
from_port = 2049
2121
to_port = 2049
2222

23-
security_groups = [
24-
"${var.efs_access_security_group_id}",
25-
]
23+
security_groups = ["${var.efs_access_security_group_ids}"]
2624
}
2725
}

efs/variables.tf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ variable "vpc_id" {
1111
description = "ID of VPC to to create EFS mount in"
1212
}
1313

14-
variable "efs_access_security_group_id" {
15-
description = "ID of the security group of the EC2 instaces that need to access the EFS"
14+
variable "efs_access_security_group_ids" {
15+
type = "list"
16+
description = "IDs of the security groups of the EC2 instances that need to access the EFS"
1617
}
1718

1819
variable "performance_mode" {

0 commit comments

Comments
 (0)