Skip to content

describe_stale_security_groups async

describe_stale_security_groups(
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    dry_run: Optional[Boolean] = None,
    max_results: Optional[DescribeStaleSecurityGroupsMaxResults] = None,
    next_token: Optional[DescribeStaleSecurityGroupsNextToken] = None,
    vpc_id: Optional[VpcId] = None,
) -> DescribeStaleSecurityGroupsResult

Describes the stale security group rules for security groups referenced across a VPC peering connection, transit gateway connection, or with a security group VPC association. Rules are stale when they reference a deleted security group. Rules can also be stale if they reference a security group in a peer VPC for which the VPC peering connection has been deleted, across a transit gateway where the transit gateway has been deleted (or the transit gateway security group referencing feature has been disabled), or if a security group VPC association has been disassociated.

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.

  • max_results (Optional[DescribeStaleSecurityGroupsMaxResults], default: None ) –

    The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see Pagination.

  • next_token (Optional[DescribeStaleSecurityGroupsNextToken], default: None ) –

    The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.

  • vpc_id (Optional[VpcId], default: None ) –

    The ID of the VPC.

Raises:

Source code in docs_src/capo_ec2/_services/async_ec2.py
async def describe_stale_security_groups(
    self,
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
    max_results: Optional[
        "capo_ec2.types.describe_stale_security_groups_max_results.DescribeStaleSecurityGroupsMaxResults"
    ] = None,
    next_token: Optional[
        "capo_ec2.types.describe_stale_security_groups_next_token.DescribeStaleSecurityGroupsNextToken"
    ] = None,
    vpc_id: Optional["capo_ec2.types.vpc_id.VpcId"] = None,
) -> "capo_ec2.types.describe_stale_security_groups_result.DescribeStaleSecurityGroupsResult":
    """<p>Describes the stale security group rules for security groups referenced across a VPC peering connection, transit gateway connection, or with a security group VPC association. Rules are stale when they reference a deleted security group. Rules can also be stale if they reference a security group in a peer VPC for which the VPC peering connection has been deleted, across a transit gateway where the transit gateway has been deleted (or <a href="https://docs.aws.amazon.com/vpc/latest/tgw/tgw-vpc-attachments.html#vpc-attachment-security">the transit gateway security group referencing feature</a> has been disabled), or if a security group VPC association has been disassociated.</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>
        max_results: <p>The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination">Pagination</a>.</p>
        next_token: <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</p>
        vpc_id: <p>The ID of the VPC.</p>

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

    async def _handler(
        req: "AsyncOperationRequest[capo_ec2.types.describe_stale_security_groups_request.DescribeStaleSecurityGroupsRequest]",
    ) -> AsyncOperationResponse[
        "capo_ec2.types.describe_stale_security_groups_result.DescribeStaleSecurityGroupsResult"
    ]:
        import capo_ec2._operations.amazon_ec2.describe_stale_security_groups

        (
            output,
            http_response,
        ) = await capo_ec2._operations.amazon_ec2.describe_stale_security_groups.async_describe_stale_security_groups(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeStaleSecurityGroups")
    )
    input_: capo_ec2.types.describe_stale_security_groups_request.DescribeStaleSecurityGroupsRequest = {}
    if dry_run is not None:
        input_["dry_run"] = dry_run
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token
    if vpc_id is not None:
        input_["vpc_id"] = vpc_id

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output