describe_mount_target_security_groups

describe_mount_target_security_groups(**kwargs)

Returns the security groups currently in effect for a mount target. 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 .

This operation requires permissions for the following actions:

  • elasticfilesystem:DescribeMountTargetSecurityGroups action on the mount target's file system.
  • ec2:DescribeNetworkInterfaceAttribute action on the mount target's network interface.

See also: AWS API Documentation

Request Syntax

response = client.describe_mount_target_security_groups(
    MountTargetId='string'
)
Parameters
MountTargetId (string) --

[REQUIRED]

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

Return type
dict
Returns
Response Syntax
{
    'SecurityGroups': [
        'string',
    ]
}

Response Structure

  • (dict) --
    • SecurityGroups (list) --

      An array of security groups.

      • (string) --

Exceptions

  • EFS.Client.exceptions.BadRequest
  • EFS.Client.exceptions.InternalServerError
  • EFS.Client.exceptions.MountTargetNotFound
  • EFS.Client.exceptions.IncorrectMountTargetState

Examples

This operation describes all of the security groups for a file system's mount target.

response = client.describe_mount_target_security_groups(
    MountTargetId='fsmt-12340abc',
)

print(response)

Expected Output:

{
    'SecurityGroups': [
        'sg-4567abcd',
    ],
    'ResponseMetadata': {
        '...': '...',
    },
}