Search⌘ K
AI Features

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.

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
...