---
title: "PUT /2015-02-01/mount-targets/{MountTargetId}/security-groups"
method: PUT
path: "/2015-02-01/mount-targets/{MountTargetId}/security-groups"
---

# PUT /2015-02-01/mount-targets/{MountTargetId}/security-groups

`PUT /2015-02-01/mount-targets/{MountTargetId}/security-groups`

Modifies the set of security groups in effect for a mount target.

When you create a mount target, Amazon EFS also creates a new network interface. For more information, see CreateMountTarget. This operation replaces the security groups in effect for the network interface associated with a mount target, with the `SecurityGroups` provided in the request. This operation requires that the network interface of the mount target has been created and the lifecycle state of the mount target is not `deleted`.

The operation requires permissions for the following actions:

*   `elasticfilesystem:ModifyMountTargetSecurityGroups` action on the mount target's file system.
    
*   `ec2:ModifyNetworkInterfaceAttribute` action on the mount target's network interface.

## Path parameters

- `MountTargetId` string, required

## Request body

- object
  - `SecurityGroups` SecurityGroup[] — An array of up to five VPC security group IDs.

## Response `204`

Success

## Other responses

- `480` — BadRequest
- `481` — InternalServerError
- `482` — MountTargetNotFound
- `483` — IncorrectMountTargetState
- `484` — SecurityGroupLimitExceeded
- `485` — SecurityGroupNotFound

---

[API](https://skmtc.net/aws/apis/elasticfilesystem.md) · [All operations](https://skmtc.net/aws/apis/elasticfilesystem/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/aws/elasticfilesystem/revisions/bd410c1b597a/schema)
