Skip to content

modify_ipam_resource_cidr

modify_ipam_resource_cidr(
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    dry_run: Optional[Boolean] = None,
    resource_id: Optional[String] = None,
    resource_cidr: Optional[String] = None,
    resource_region: Optional[String] = None,
    current_ipam_scope_id: Optional[IpamScopeId] = None,
    destination_ipam_scope_id: Optional[IpamScopeId] = None,
    monitored: Optional[Boolean] = None,
) -> ModifyIpamResourceCidrResult

Modify a resource CIDR. You can use this action to transfer resource CIDRs between scopes and ignore resource CIDRs that you do not want to manage. If set to false, the resource will not be tracked for overlap, it cannot be auto-imported into a pool, and it will be removed from any pool it has an allocation in.

For more information, see Move resource CIDRs between scopes and Change the monitoring state of resource CIDRs 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.

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

    The ID of the resource you want to modify.

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

    The CIDR of the resource you want to modify.

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

    The Amazon Web Services Region of the resource you want to modify.

  • current_ipam_scope_id (Optional[IpamScopeId], default: None ) –

    The ID of the current scope that the resource CIDR is in.

  • destination_ipam_scope_id (Optional[IpamScopeId], default: None ) –

    The ID of the scope you want to transfer the resource CIDR to.

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

    Determines if the resource is monitored by IPAM. If a resource is monitored, the resource is discovered by IPAM and you can view details about the resource’s CIDR.

Raises:

Source code in docs_src/capo_ec2/_services/ec2.py
def modify_ipam_resource_cidr(
    self,
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
    resource_id: Optional["capo_ec2.types.string.String"] = None,
    resource_cidr: Optional["capo_ec2.types.string.String"] = None,
    resource_region: Optional["capo_ec2.types.string.String"] = None,
    current_ipam_scope_id: Optional[
        "capo_ec2.types.ipam_scope_id.IpamScopeId"
    ] = None,
    destination_ipam_scope_id: Optional[
        "capo_ec2.types.ipam_scope_id.IpamScopeId"
    ] = None,
    monitored: Optional["capo_ec2.types.boolean.Boolean"] = None,
) -> "capo_ec2.types.modify_ipam_resource_cidr_result.ModifyIpamResourceCidrResult":
    """<p>Modify a resource CIDR. You can use this action to transfer resource CIDRs between scopes and ignore resource CIDRs that you do not want to manage. If set to false, the resource will not be tracked for overlap, it cannot be auto-imported into a pool, and it will be removed from any pool it has an allocation in.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/vpc/latest/ipam/move-resource-ipam.html">Move resource CIDRs between scopes</a> and <a href="https://docs.aws.amazon.com/vpc/latest/ipam/change-monitoring-state-ipam.html">Change the monitoring state of resource CIDRs</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>
        resource_id: <p>The ID of the resource you want to modify.</p>
        resource_cidr: <p>The CIDR of the resource you want to modify.</p>
        resource_region: <p>The Amazon Web Services Region of the resource you want to modify.</p>
        current_ipam_scope_id: <p>The ID of the current scope that the resource CIDR is in.</p>
        destination_ipam_scope_id: <p>The ID of the scope you want to transfer the resource CIDR to.</p>
        monitored: <p>Determines if the resource is monitored by IPAM. If a resource is monitored, the resource is discovered by IPAM and you can view details about the resource’s 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.modify_ipam_resource_cidr_request.ModifyIpamResourceCidrRequest]",
    ) -> OperationResponse[
        "capo_ec2.types.modify_ipam_resource_cidr_result.ModifyIpamResourceCidrResult"
    ]:
        import capo_ec2._operations.amazon_ec2.modify_ipam_resource_cidr

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ModifyIpamResourceCidr")
    )
    input_: capo_ec2.types.modify_ipam_resource_cidr_request.ModifyIpamResourceCidrRequest = {}
    if dry_run is not None:
        input_["dry_run"] = dry_run
    if resource_id is not None:
        input_["resource_id"] = resource_id
    if resource_cidr is not None:
        input_["resource_cidr"] = resource_cidr
    if resource_region is not None:
        input_["resource_region"] = resource_region
    if current_ipam_scope_id is not None:
        input_["current_ipam_scope_id"] = current_ipam_scope_id
    if destination_ipam_scope_id is not None:
        input_["destination_ipam_scope_id"] = destination_ipam_scope_id
    if monitored is not None:
        input_["monitored"] = monitored

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