Skip to content

deprovision_ipam_byoasn

deprovision_ipam_byoasn(
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    dry_run: Optional[Boolean] = None,
    ipam_id: Optional[IpamId] = None,
    asn: Optional[String] = None,
) -> DeprovisionIpamByoasnResult

Deprovisions your Autonomous System Number (ASN) from your Amazon Web Services account. This action can only be called after any BYOIP CIDR associations are removed from your Amazon Web Services account with DisassociateIpamByoasn. For more information, see Tutorial: Bring your ASN to IPAM in the Amazon VPC IPAM guide.

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.

  • ipam_id (Optional[IpamId], default: None ) –

    The IPAM ID.

  • asn (Optional[String], default: None ) –

    An ASN.

Raises:

Source code in docs_src/capo_ec2/_services/ec2.py
def deprovision_ipam_byoasn(
    self,
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
    ipam_id: Optional["capo_ec2.types.ipam_id.IpamId"] = None,
    asn: Optional["capo_ec2.types.string.String"] = None,
) -> "capo_ec2.types.deprovision_ipam_byoasn_result.DeprovisionIpamByoasnResult":
    """<p>Deprovisions your Autonomous System Number (ASN) from your Amazon Web Services account. This action can only be called after any BYOIP CIDR associations are removed from your Amazon Web Services account with <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DisassociateIpamByoasn.html">DisassociateIpamByoasn</a>. For more information, see <a href="https://docs.aws.amazon.com/vpc/latest/ipam/tutorials-byoasn.html">Tutorial: Bring your ASN to IPAM</a> in the <i>Amazon VPC IPAM guide</i>.</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>
        ipam_id: <p>The IPAM ID.</p>
        asn: <p>An ASN.</p>

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

    def _handler(
        req: "OperationRequest[capo_ec2.types.deprovision_ipam_byoasn_request.DeprovisionIpamByoasnRequest]",
    ) -> OperationResponse[
        "capo_ec2.types.deprovision_ipam_byoasn_result.DeprovisionIpamByoasnResult"
    ]:
        import capo_ec2._operations.amazon_ec2.deprovision_ipam_byoasn

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeprovisionIpamByoasn")
    )
    input_: capo_ec2.types.deprovision_ipam_byoasn_request.DeprovisionIpamByoasnRequest = {}
    if dry_run is not None:
        input_["dry_run"] = dry_run
    if ipam_id is not None:
        input_["ipam_id"] = ipam_id
    if asn is not None:
        input_["asn"] = asn

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