Skip to content

describe_security_group_references async

describe_security_group_references(
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = 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.

>>> await client.describe_security_group_references(group_id=['sg-903004f8'])
Source code in docs_src/capo_ec2/_services/async_ec2.py
async def describe_security_group_references(
    self,
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = 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.

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

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

        (
            output,
            http_response,
        ) = await capo_ec2._operations.amazon_ec2.describe_security_group_references.async_describe_security_group_references(
            req.options, req.input
        )
        return AsyncOperationResponse(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 = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output