describe_security_group_references

EC2.Client.describe_security_group_references(**kwargs)

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

See also: AWS API Documentation

Request Syntax

response = client.describe_security_group_references(
    DryRun=True|False,
    GroupId=[
        'string',
    ]
)
Parameters
  • DryRun (boolean) -- 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 .
  • GroupId (list) --

    [REQUIRED]

    The IDs of the security groups in your account.

    • (string) --
Return type

dict

Returns

Response Syntax

{
    'SecurityGroupReferenceSet': [
        {
            'GroupId': 'string',
            'ReferencingVpcId': 'string',
            'VpcPeeringConnectionId': '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.

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': {
        '...': '...',
    },
}