Skip to content

modify_ipam_pool async

modify_ipam_pool(
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    dry_run: Optional[Boolean] = None,
    ipam_pool_id: Optional[IpamPoolId] = None,
    description: Optional[String] = None,
    auto_import: Optional[Boolean] = None,
    allocation_min_netmask_length: Optional[IpamNetmaskLength] = None,
    allocation_max_netmask_length: Optional[IpamNetmaskLength] = None,
    allocation_default_netmask_length: Optional[IpamNetmaskLength] = None,
    clear_allocation_default_netmask_length: Optional[Boolean] = None,
    add_allocation_resource_tags: Optional[RequestIpamResourceTagList] = None,
    remove_allocation_resource_tags: Optional[RequestIpamResourceTagList] = None,
) -> ModifyIpamPoolResult

Modify the configurations of an IPAM pool.

For more information, see Modify a pool 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 want to modify.

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

    The description of the IPAM pool you want to modify.

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

    If true, IPAM will continuously look for resources within the CIDR range of this pool and automatically import them as allocations into your IPAM. The CIDRs that will be allocated for these resources must not already be allocated to other resources in order for the import to succeed. IPAM will import a CIDR regardless of its compliance with the pool's allocation rules, so a resource might be imported and subsequently marked as noncompliant. If IPAM discovers multiple CIDRs that overlap, IPAM will import the largest CIDR only. If IPAM discovers multiple CIDRs with matching CIDRs, IPAM will randomly import one of them only.

    A locale must be set on the pool for this feature to work.

  • allocation_min_netmask_length (Optional[IpamNetmaskLength], default: None ) –

    The minimum netmask length required for CIDR allocations in this IPAM pool to be compliant. Possible netmask lengths for IPv4 addresses are 0 - 32. Possible netmask lengths for IPv6 addresses are 0 - 128. The minimum netmask length must be less than the maximum netmask length.

  • allocation_max_netmask_length (Optional[IpamNetmaskLength], default: None ) –

    The maximum netmask length possible for CIDR allocations in this IPAM pool to be compliant. Possible netmask lengths for IPv4 addresses are 0 - 32. Possible netmask lengths for IPv6 addresses are 0 - 128.The maximum netmask length must be greater than the minimum netmask length.

  • allocation_default_netmask_length (Optional[IpamNetmaskLength], default: None ) –

    The default netmask length for allocations added to this pool. If, for example, the CIDR assigned to this pool is 10.0.0.0/8 and you enter 16 here, new allocations will default to 10.0.0.0/16.

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

    Clear the default netmask length allocation rule for this pool.

  • add_allocation_resource_tags (Optional[RequestIpamResourceTagList], default: None ) –

    Add tag allocation rules to a pool. For more information about allocation rules, see Create a top-level pool in the Amazon VPC IPAM User Guide.

  • remove_allocation_resource_tags (Optional[RequestIpamResourceTagList], default: None ) –

    Remove tag allocation rules from a pool.

Raises:

Source code in docs_src/capo_ec2/_services/async_ec2.py
async def modify_ipam_pool(
    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,
    description: Optional["capo_ec2.types.string.String"] = None,
    auto_import: Optional["capo_ec2.types.boolean.Boolean"] = None,
    allocation_min_netmask_length: Optional[
        "capo_ec2.types.ipam_netmask_length.IpamNetmaskLength"
    ] = None,
    allocation_max_netmask_length: Optional[
        "capo_ec2.types.ipam_netmask_length.IpamNetmaskLength"
    ] = None,
    allocation_default_netmask_length: Optional[
        "capo_ec2.types.ipam_netmask_length.IpamNetmaskLength"
    ] = None,
    clear_allocation_default_netmask_length: Optional[
        "capo_ec2.types.boolean.Boolean"
    ] = None,
    add_allocation_resource_tags: Optional[
        "capo_ec2.types.request_ipam_resource_tag_list.RequestIpamResourceTagList"
    ] = None,
    remove_allocation_resource_tags: Optional[
        "capo_ec2.types.request_ipam_resource_tag_list.RequestIpamResourceTagList"
    ] = None,
) -> "capo_ec2.types.modify_ipam_pool_result.ModifyIpamPoolResult":
    """<p>Modify the configurations of an IPAM pool.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/vpc/latest/ipam/mod-pool-ipam.html">Modify a pool</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 want to modify.</p>
        description: <p>The description of the IPAM pool you want to modify.</p>
        auto_import: <p>If true, IPAM will continuously look for resources within the CIDR range of this pool and automatically import them as allocations into your IPAM. The CIDRs that will be allocated for these resources must not already be allocated to other resources in order for the import to succeed. IPAM will import a CIDR regardless of its compliance with the pool's allocation rules, so a resource might be imported and subsequently marked as noncompliant. If IPAM discovers multiple CIDRs that overlap, IPAM will import the largest CIDR only. If IPAM discovers multiple CIDRs with matching CIDRs, IPAM will randomly import one of them only. </p> <p>A locale must be set on the pool for this feature to work.</p>
        allocation_min_netmask_length: <p>The minimum netmask length required for CIDR allocations in this IPAM pool to be compliant. Possible netmask lengths for IPv4 addresses are 0 - 32. Possible netmask lengths for IPv6 addresses are 0 - 128. The minimum netmask length must be less than the maximum netmask length.</p>
        allocation_max_netmask_length: <p>The maximum netmask length possible for CIDR allocations in this IPAM pool to be compliant. Possible netmask lengths for IPv4 addresses are 0 - 32. Possible netmask lengths for IPv6 addresses are 0 - 128.The maximum netmask length must be greater than the minimum netmask length.</p>
        allocation_default_netmask_length: <p>The default netmask length for allocations added to this pool. If, for example, the CIDR assigned to this pool is 10.0.0.0/8 and you enter 16 here, new allocations will default to 10.0.0.0/16.</p>
        clear_allocation_default_netmask_length: <p>Clear the default netmask length allocation rule for this pool.</p>
        add_allocation_resource_tags: <p>Add tag allocation rules to a pool. For more information about allocation rules, see <a href="https://docs.aws.amazon.com/vpc/latest/ipam/create-top-ipam.html">Create a top-level pool</a> in the <i>Amazon VPC IPAM User Guide</i>.</p>
        remove_allocation_resource_tags: <p>Remove tag allocation rules from a pool.</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.modify_ipam_pool_request.ModifyIpamPoolRequest]",
    ) -> AsyncOperationResponse[
        "capo_ec2.types.modify_ipam_pool_result.ModifyIpamPoolResult"
    ]:
        import capo_ec2._operations.amazon_ec2.modify_ipam_pool

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ModifyIpamPool")
    )
    input_: capo_ec2.types.modify_ipam_pool_request.ModifyIpamPoolRequest = {}
    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 description is not None:
        input_["description"] = description
    if auto_import is not None:
        input_["auto_import"] = auto_import
    if allocation_min_netmask_length is not None:
        input_["allocation_min_netmask_length"] = allocation_min_netmask_length
    if allocation_max_netmask_length is not None:
        input_["allocation_max_netmask_length"] = allocation_max_netmask_length
    if allocation_default_netmask_length is not None:
        input_["allocation_default_netmask_length"] = (
            allocation_default_netmask_length
        )
    if clear_allocation_default_netmask_length is not None:
        input_["clear_allocation_default_netmask_length"] = (
            clear_allocation_default_netmask_length
        )
    if add_allocation_resource_tags is not None:
        input_["add_allocation_resource_tags"] = add_allocation_resource_tags
    if remove_allocation_resource_tags is not None:
        input_["remove_allocation_resource_tags"] = remove_allocation_resource_tags

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