EC2 / Client / describe_security_group_references
describe_security_group_references#
- 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
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 isUnauthorizedOperation
.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', '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 in the VPC Peering Guide.
TransitGatewayId (string) –
Note
This parameter is in preview and may not be available for your account.
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': { '...': '...', }, }