:doc:`EC2 <../../ec2>` / Client / describe_security_group_references

**********************************
describe_security_group_references
**********************************



.. py:method:: EC2.Client.describe_security_group_references(**kwargs)

  

  Describes the VPCs on the other side of a VPC peering or Transit Gateway connection that are referencing the security groups you've specified in this request.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSecurityGroupReferences>`_  


  **Request Syntax**
  ::

    response = client.describe_security_group_references(
        DryRun=True|False,
        GroupId=[
            'string',
        ]
    )
    
  :type DryRun: boolean
  :param DryRun: 

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is ``DryRunOperation``. Otherwise, it is ``UnauthorizedOperation``.

    

  
  :type GroupId: list
  :param GroupId: **[REQUIRED]** 

    The IDs of the security groups in your account.

    

  
    - *(string) --* 

    

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

    
    ::

      {
          'SecurityGroupReferenceSet': [
              {
                  'GroupId': 'string',
                  'ReferencingVpcId': 'string',
                  'VpcPeeringConnectionId': 'string',
                  'TransitGatewayId': 'string'
              },
          ]
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **SecurityGroupReferenceSet** *(list) --* 

        Information about the VPCs with the referencing security groups.

        
        

        - *(dict) --* 

          Describes a VPC with a security group that references your security group.

          
          

          - **GroupId** *(string) --* 

            The ID of your security group.

            
          

          - **ReferencingVpcId** *(string) --* 

            The ID of the VPC with the referencing security group.

            
          

          - **VpcPeeringConnectionId** *(string) --* 

            The ID of the VPC peering connection (if applicable). For more information about security group referencing for peering connections, see `Update your security groups to reference peer security groups <https://docs.aws.amazon.com/vpc/latest/peering/vpc-peering-security-groups.html>`__ in the *VPC Peering Guide*.

            
          

          - **TransitGatewayId** *(string) --* 

            The ID of the transit gateway (if applicable).

            
      
    
  

  **Examples**

  This example describes the security group references for the specified security group.
  ::

    response = client.describe_security_group_references(
        GroupId=[
            'sg-903004f8',
        ],
    )
    
    print(response)

  
  Expected Output:
  ::

    {
        'SecurityGroupReferenceSet': [
            {
                'GroupId': 'sg-903004f8',
                'ReferencingVpcId': 'vpc-1a2b3c4d',
                'VpcPeeringConnectionId': 'pcx-b04deed9',
            },
        ],
        'ResponseMetadata': {
            '...': '...',
        },
    }

  