Skip to content

provision_ipam_pool_cidr async

provision_ipam_pool_cidr(
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    dry_run: Optional[Boolean] = None,
    ipam_pool_id: Optional[IpamPoolId] = None,
    cidr: Optional[String] = None,
    cidr_authorization_context: Optional[IpamCidrAuthorizationContext] = None,
    netmask_length: Optional[Integer] = None,
    client_token: Optional[String] = None,
    verification_method: Optional[VerificationMethod] = None,
    ipam_external_resource_verification_token_id: Optional[
        IpamExternalResourceVerificationTokenId
    ] = None,
) -> ProvisionIpamPoolCidrResult

Provision a CIDR to an IPAM pool. You can use this action to provision new CIDRs to a top-level pool or to transfer a CIDR from a top-level pool to a pool within it.

For more information, see Provision CIDRs to pools in the Amazon VPC IPAM User Guide.

Parameters:

  • dry_run (Optional[Boolean], default: None ) –

    A check for 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_pool_id (Optional[IpamPoolId], default: None ) –

    The ID of the IPAM pool to which you want to assign a CIDR.

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

    The CIDR you want to assign to the IPAM pool. Either "NetmaskLength" or "Cidr" is required. This value will be null if you specify "NetmaskLength" and will be filled in during the provisioning process.

  • cidr_authorization_context (Optional[IpamCidrAuthorizationContext], default: None ) –

    A signed document that proves that you are authorized to bring a specified IP address range to Amazon using BYOIP. This option only applies to IPv4 and IPv6 pools in the public scope.

  • netmask_length (Optional[Integer], default: None ) –

    The netmask length of the CIDR you'd like to provision to a pool. Can be used for provisioning Amazon-provided IPv6 CIDRs to top-level pools and for provisioning CIDRs to pools with source pools. Cannot be used to provision BYOIP CIDRs to top-level pools. Either "NetmaskLength" or "Cidr" is required.

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

    A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see Ensuring idempotency.

  • verification_method (Optional[VerificationMethod], default: None ) –

    The method for verifying control of a public IP address range. Defaults to remarks-x509 if not specified. This option only applies to IPv4 and IPv6 pools in the public scope.

  • ipam_external_resource_verification_token_id (Optional[IpamExternalResourceVerificationTokenId], default: None ) –

    Verification token ID. This option only applies to IPv4 and IPv6 pools in the public scope.

Raises:

Source code in docs_src/capo_ec2/_services/async_ec2.py
async def provision_ipam_pool_cidr(
    self,
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
    ipam_pool_id: Optional["capo_ec2.types.ipam_pool_id.IpamPoolId"] = None,
    cidr: Optional["capo_ec2.types.string.String"] = None,
    cidr_authorization_context: Optional[
        "capo_ec2.types.ipam_cidr_authorization_context.IpamCidrAuthorizationContext"
    ] = None,
    netmask_length: Optional["capo_ec2.types.integer.Integer"] = None,
    client_token: Optional["capo_ec2.types.string.String"] = None,
    verification_method: Optional[
        "capo_ec2.types.verification_method.VerificationMethod"
    ] = None,
    ipam_external_resource_verification_token_id: Optional[
        "capo_ec2.types.ipam_external_resource_verification_token_id.IpamExternalResourceVerificationTokenId"
    ] = None,
) -> "capo_ec2.types.provision_ipam_pool_cidr_result.ProvisionIpamPoolCidrResult":
    """<p>Provision a CIDR to an IPAM pool. You can use this action to provision new CIDRs to a top-level pool or to transfer a CIDR from a top-level pool to a pool within it.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/vpc/latest/ipam/prov-cidr-ipam.html">Provision CIDRs to pools</a> in the <i>Amazon VPC IPAM User Guide</i>. </p>

    Args:
        dry_run: <p>A check for 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_pool_id: <p>The ID of the IPAM pool to which you want to assign a CIDR.</p>
        cidr: <p>The CIDR you want to assign to the IPAM pool. Either "NetmaskLength" or "Cidr" is required. This value will be null if you specify "NetmaskLength" and will be filled in during the provisioning process.</p>
        cidr_authorization_context: <p>A signed document that proves that you are authorized to bring a specified IP address range to Amazon using BYOIP. This option only applies to IPv4 and IPv6 pools in the public scope.</p>
        netmask_length: <p>The netmask length of the CIDR you'd like to provision to a pool. Can be used for provisioning Amazon-provided IPv6 CIDRs to top-level pools and for provisioning CIDRs to pools with source pools. Cannot be used to provision BYOIP CIDRs to top-level pools. Either "NetmaskLength" or "Cidr" is required.</p>
        client_token: <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see <a href="https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html">Ensuring idempotency</a>.</p>
        verification_method: <p>The method for verifying control of a public IP address range. Defaults to <code>remarks-x509</code> if not specified. This option only applies to IPv4 and IPv6 pools in the public scope.</p>
        ipam_external_resource_verification_token_id: <p>Verification token ID. This option only applies to IPv4 and IPv6 pools in the public scope.</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.provision_ipam_pool_cidr_request.ProvisionIpamPoolCidrRequest]",
    ) -> AsyncOperationResponse[
        "capo_ec2.types.provision_ipam_pool_cidr_result.ProvisionIpamPoolCidrResult"
    ]:
        import capo_ec2._operations.amazon_ec2.provision_ipam_pool_cidr

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ProvisionIpamPoolCidr")
    )
    input_: capo_ec2.types.provision_ipam_pool_cidr_request.ProvisionIpamPoolCidrRequest = {}
    if dry_run is not None:
        input_["dry_run"] = dry_run
    if ipam_pool_id is not None:
        input_["ipam_pool_id"] = ipam_pool_id
    if cidr is not None:
        input_["cidr"] = cidr
    if cidr_authorization_context is not None:
        input_["cidr_authorization_context"] = cidr_authorization_context
    if netmask_length is not None:
        input_["netmask_length"] = netmask_length
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if verification_method is not None:
        input_["verification_method"] = verification_method
    if ipam_external_resource_verification_token_id is not None:
        input_["ipam_external_resource_verification_token_id"] = (
            ipam_external_resource_verification_token_id
        )

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