Skip to content

associate_ipam_byoasn

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

Associates your Autonomous System Number (ASN) with a BYOIP CIDR that you own in the same Amazon Web Services Region. For more information, see Tutorial: Bring your ASN to IPAM in the Amazon VPC IPAM guide.

After the association succeeds, the ASN is eligible for advertisement. You can view the association with DescribeByoipCidrs. You can advertise the CIDR with AdvertiseByoipCidr.

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 ) –

    The BYOIP CIDR you want to associate with an ASN.

Raises:

Source code in docs_src/capo_ec2/_services/ec2.py
def associate_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.associate_ipam_byoasn_result.AssociateIpamByoasnResult":
    """<p>Associates your Autonomous System Number (ASN) with a BYOIP CIDR that you own in the same Amazon Web Services Region. 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> <p>After the association succeeds, the ASN is eligible for advertisement. You can view the association with <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeByoipCidrs.html">DescribeByoipCidrs</a>. You can advertise the CIDR with <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_AdvertiseByoipCidr.html">AdvertiseByoipCidr</a>.</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>The BYOIP CIDR you want to associate with 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.associate_ipam_byoasn_request.AssociateIpamByoasnRequest]",
    ) -> OperationResponse[
        "capo_ec2.types.associate_ipam_byoasn_result.AssociateIpamByoasnResult"
    ]:
        import capo_ec2._operations.amazon_ec2.associate_ipam_byoasn

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("AssociateIpamByoasn")
    )
    input_: capo_ec2.types.associate_ipam_byoasn_request.AssociateIpamByoasnRequest = {}
    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