Skip to content

provision_public_ipv4_pool_cidr async

provision_public_ipv4_pool_cidr(
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    dry_run: Optional[Boolean] = None,
    ipam_pool_id: Optional[IpamPoolId] = None,
    pool_id: Optional[Ipv4PoolEc2Id] = None,
    netmask_length: Optional[Integer] = None,
    network_border_group: Optional[String] = None,
) -> ProvisionPublicIpv4PoolCidrResult

Provision a CIDR to a public IPv4 pool.

For more information about IPAM, see What is IPAM? 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 you would like to use to allocate this CIDR.

  • pool_id (Optional[Ipv4PoolEc2Id], default: None ) –

    The ID of the public IPv4 pool you would like to use for this CIDR.

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

    The netmask length of the CIDR you would like to allocate to the public IPv4 pool. The least specific netmask length you can define is 24.

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

    The Availability Zone (AZ) or Local Zone (LZ) network border group that the resource that the IP address is assigned to is in. Defaults to an AZ network border group. For more information on available Local Zones, see Local Zone availability in the Amazon EC2 User Guide.

Raises:

Source code in docs_src/capo_ec2/_services/async_ec2.py
async def provision_public_ipv4_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,
    pool_id: Optional["capo_ec2.types.ipv4_pool_ec2_id.Ipv4PoolEc2Id"] = None,
    netmask_length: Optional["capo_ec2.types.integer.Integer"] = None,
    network_border_group: Optional["capo_ec2.types.string.String"] = None,
) -> "capo_ec2.types.provision_public_ipv4_pool_cidr_result.ProvisionPublicIpv4PoolCidrResult":
    """<p>Provision a CIDR to a public IPv4 pool.</p> <p>For more information about IPAM, see <a href="https://docs.aws.amazon.com/vpc/latest/ipam/what-is-it-ipam.html">What is IPAM?</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 you would like to use to allocate this CIDR.</p>
        pool_id: <p>The ID of the public IPv4 pool you would like to use for this CIDR.</p>
        netmask_length: <p>The netmask length of the CIDR you would like to allocate to the public IPv4 pool. The least specific netmask length you can define is 24.</p>
        network_border_group: <p>The Availability Zone (AZ) or Local Zone (LZ) network border group that the resource that the IP address is assigned to is in. Defaults to an AZ network border group. For more information on available Local Zones, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-byoip.html#byoip-zone-avail">Local Zone availability</a> in the <i>Amazon EC2 User Guide</i>.</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_public_ipv4_pool_cidr_request.ProvisionPublicIpv4PoolCidrRequest]",
    ) -> AsyncOperationResponse[
        "capo_ec2.types.provision_public_ipv4_pool_cidr_result.ProvisionPublicIpv4PoolCidrResult"
    ]:
        import capo_ec2._operations.amazon_ec2.provision_public_ipv4_pool_cidr

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ProvisionPublicIpv4PoolCidr")
    )
    input_: capo_ec2.types.provision_public_ipv4_pool_cidr_request.ProvisionPublicIpv4PoolCidrRequest = {}
    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 pool_id is not None:
        input_["pool_id"] = pool_id
    if netmask_length is not None:
        input_["netmask_length"] = netmask_length
    if network_border_group is not None:
        input_["network_border_group"] = network_border_group

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