Attaching a Security Group to EFS Mount Targets
Discover how to secure AWS EFS mount targets by attaching security groups using the AWS CLI. Learn to retrieve mount target IDs, use the modify-mount-target-security-groups command, and automate the process with xargs for multiple targets.
We'll cover the following...
We'll cover the following...
Steps to attach the security groups
We have already created the security group efs-access with the matching security group ingress rule. Now, it’s time to attach this security group to our EFS mount targets. We will perform the following steps:
- To attach the security group, we can use the
modify-mount-target-security-groupsCLI command. - To use it, we need to specify the mount target via
--mount-target-idand the security group(s) via--security-groups. The--security-groupsparameter only takes security group