Attaching a Security Group to EFS Mount Targets

Learn to attach the security group to the EFS mount targets.

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:

  1. To attach the security group, we can use the modify-mount-target-security-groups CLI command.
  2. To use it, we need to specify the mount target via --mount-target-id and the security group(s) via --security-groups. The --security-groups parameter only takes security group IDs.
  3. To get the security group ID, we could either copy it from last lesson or use the describe-security-groups command again:

Get hands-on with 1200+ tech skills courses.