Skip to content

disassociate_ipam_byoasn

disassociate_ipam_byoasn(
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    dry_run: Optional[Boolean] = None,
    asn: Optional[String] = None,
    cidr: Optional[String] = None,
) -> DisassociateIpamByoasnResult

Remove the association between your Autonomous System Number (ASN) and your BYOIP CIDR. You may want to use this action to disassociate an ASN from a CIDR or if you want to swap ASNs. 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.

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

    A public 2-byte or 4-byte ASN.

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

    A BYOIP CIDR.

Raises:

Source code in docs_src/capo_ec2/_services/ec2.py
def disassociate_ipam_byoasn(
    self,
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
    asn: Optional["capo_ec2.types.string.String"] = None,
    cidr: Optional["capo_ec2.types.string.String"] = None,
) -> "capo_ec2.types.disassociate_ipam_byoasn_result.DisassociateIpamByoasnResult":
    """<p>Remove the association between your Autonomous System Number (ASN) and your BYOIP CIDR. You may want to use this action to disassociate an ASN from a CIDR or if you want to swap ASNs. 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>
        asn: <p>A public 2-byte or 4-byte ASN.</p>
        cidr: <p>A BYOIP CIDR.</p>

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

    def _handler(
        req: "OperationRequest[capo_ec2.types.disassociate_ipam_byoasn_request.DisassociateIpamByoasnRequest]",
    ) -> OperationResponse[
        "capo_ec2.types.disassociate_ipam_byoasn_result.DisassociateIpamByoasnResult"
    ]:
        import capo_ec2._operations.amazon_ec2.disassociate_ipam_byoasn

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DisassociateIpamByoasn")
    )
    input_: capo_ec2.types.disassociate_ipam_byoasn_request.DisassociateIpamByoasnRequest = {}
    if dry_run is not None:
        input_["dry_run"] = dry_run
    if asn is not None:
        input_["asn"] = asn
    if cidr is not None:
        input_["cidr"] = cidr

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