:doc:`EFS <../../efs>` / Client / describe_mount_target_security_groups

*************************************
describe_mount_target_security_groups
*************************************



.. py:method:: EFS.Client.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 <https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/DescribeMountTargetSecurityGroups>`_  


  **Request Syntax**
  ::

    response = client.describe_mount_target_security_groups(
        MountTargetId='string'
    )
    
  :type MountTargetId: string
  :param MountTargetId: **[REQUIRED]** 

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

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'SecurityGroups': [
              'string',
          ]
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **SecurityGroups** *(list) --* 

        An array of security groups.

        
        

        - *(string) --* 
    
  
  **Exceptions**
  
  *   :py:class:`EFS.Client.exceptions.BadRequest`

  
  *   :py:class:`EFS.Client.exceptions.InternalServerError`

  
  *   :py:class:`EFS.Client.exceptions.MountTargetNotFound`

  
  *   :py:class:`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': {
            '...': '...',
        },
    }

  