Skip to content

describe_security_group_references

describe_security_group_references(
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    dry_run: Optional[Boolean] = None,
    group_id: Optional[GroupIds] = None,
) -> DescribeSecurityGroupReferencesResult

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.

Parameters:

  • dry_run (Optional[Boolean], default: None ) –

    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.

  • group_id (Optional[GroupIds], default: None ) –

    The IDs of the security groups in your account.

Raises:

Examples:

To describe security group references This example describes the security group references for the specified security group.

>>> client.describe_security_group_references(group_id=['sg-903004f8'])
Source code in docs_src/capo_ec2/_services/ec2.py
def describe_security_group_references(
    self,
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
    group_id: Optional["capo_ec2.types.group_ids.GroupIds"] = None,
) -> "capo_ec2.types.describe_security_group_references_result.DescribeSecurityGroupReferencesResult":
    """<p>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.</p>

    Args:
        dry_run: <p>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 <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
        group_id: <p>The IDs of the security groups in your account.</p>

    Raises:
        capo_ec2.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To describe security group references
        This example describes the security group references for the specified security group.

        >>> client.describe_security_group_references(group_id=['sg-903004f8'])
    """

    def _handler(
        req: "OperationRequest[capo_ec2.types.describe_security_group_references_request.DescribeSecurityGroupReferencesRequest]",
    ) -> OperationResponse[
        "capo_ec2.types.describe_security_group_references_result.DescribeSecurityGroupReferencesResult"
    ]:
        import capo_ec2._operations.amazon_ec2.describe_security_group_references

        output, http_response = (
            capo_ec2._operations.amazon_ec2.describe_security_group_references.describe_security_group_references(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeSecurityGroupReferences")
    )
    input_: capo_ec2.types.describe_security_group_references_request.DescribeSecurityGroupReferencesRequest = {}
    if dry_run is not None:
        input_["dry_run"] = dry_run
    if group_id is not None:
        input_["group_id"] = group_id

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output