This gist provides a sample terraform configuration to use EFS volume in ECS task running on EC2:
- Create a security group
A
for serviceB
- Create a security group for EFS to allow
B
- Create EFS file system
C
and mount target on multiple subnets - Create ECS task
D
with EFS volumeC
- Create ECS service for ECS task
C
with security groupA