Method: Aws::EFS::Client#modify_mount_target_security_groups

Defined in:
lib/aws-sdk-efs/client.rb

#modify_mount_target_security_groups(params = {}) ⇒ Struct

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.

Examples:

Example: To modify the security groups associated with a mount target for a file system


# This operation modifies the security groups associated with a mount target for a file system.

resp = client.modify_mount_target_security_groups({
  mount_target_id: "fsmt-12340abc", 
  security_groups: [
    "sg-abcd1234", 
  ], 
})

Request syntax with placeholder values


resp = client.modify_mount_target_security_groups({
  mount_target_id: "MountTargetId", # required
  security_groups: ["SecurityGroup"],
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :mount_target_id (required, String)

    The ID of the mount target whose security groups you want to modify.

  • :security_groups (Array<String>)

    An array of VPC security group IDs.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



2412
2413
2414
2415
# File 'lib/aws-sdk-efs/client.rb', line 2412

def modify_mount_target_security_groups(params = {}, options = {})
  req = build_request(:modify_mount_target_security_groups, params)
  req.send_request(options)
end