Skip to content

modify_managed_prefix_list

modify_managed_prefix_list(
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    dry_run: Optional[Boolean] = None,
    prefix_list_id: Optional[PrefixListResourceId] = None,
    current_version: Optional[Long] = None,
    prefix_list_name: Optional[String] = None,
    add_entries: Optional[AddPrefixListEntries] = None,
    remove_entries: Optional[RemovePrefixListEntries] = None,
    max_entries: Optional[Integer] = None,
    ipam_prefix_list_resolver_sync_enabled: Optional[BoxedBoolean] = None,
) -> ModifyManagedPrefixListResult

Modifies the specified managed prefix list.

Adding or removing entries in a prefix list creates a new version of the prefix list. Changing the name of the prefix list does not affect the version.

If you specify a current version number that does not match the true current version number, the request fails.

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.

  • prefix_list_id (Optional[PrefixListResourceId], default: None ) –

    The ID of the prefix list.

  • current_version (Optional[Long], default: None ) –

    The current version of the prefix list.

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

    A name for the prefix list.

  • add_entries (Optional[AddPrefixListEntries], default: None ) –

    One or more entries to add to the prefix list.

  • remove_entries (Optional[RemovePrefixListEntries], default: None ) –

    One or more entries to remove from the prefix list.

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

    The maximum number of entries for the prefix list. You cannot modify the entries of a prefix list and modify the size of a prefix list at the same time.

    If any of the resources that reference the prefix list cannot support the new maximum size, the modify operation fails. Check the state message for the IDs of the first ten resources that do not support the new maximum size.

  • ipam_prefix_list_resolver_sync_enabled (Optional[BoxedBoolean], default: None ) –

    Indicates whether synchronization with an IPAM prefix list resolver should be enabled for this managed prefix list. When enabled, the prefix list CIDRs are automatically updated based on the associated resolver's CIDR selection rules.

Raises:

Source code in docs_src/capo_ec2/_services/ec2.py
def modify_managed_prefix_list(
    self,
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
    prefix_list_id: Optional[
        "capo_ec2.types.prefix_list_resource_id.PrefixListResourceId"
    ] = None,
    current_version: Optional["capo_ec2.types.long.Long"] = None,
    prefix_list_name: Optional["capo_ec2.types.string.String"] = None,
    add_entries: Optional[
        "capo_ec2.types.add_prefix_list_entries.AddPrefixListEntries"
    ] = None,
    remove_entries: Optional[
        "capo_ec2.types.remove_prefix_list_entries.RemovePrefixListEntries"
    ] = None,
    max_entries: Optional["capo_ec2.types.integer.Integer"] = None,
    ipam_prefix_list_resolver_sync_enabled: Optional[
        "capo_ec2.types.boxed_boolean.BoxedBoolean"
    ] = None,
) -> (
    "capo_ec2.types.modify_managed_prefix_list_result.ModifyManagedPrefixListResult"
):
    """<p>Modifies the specified managed prefix list.</p> <p>Adding or removing entries in a prefix list creates a new version of the prefix list. Changing the name of the prefix list does not affect the version.</p> <p>If you specify a current version number that does not match the true current version number, the request fails.</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>
        prefix_list_id: <p>The ID of the prefix list.</p>
        current_version: <p>The current version of the prefix list.</p>
        prefix_list_name: <p>A name for the prefix list.</p>
        add_entries: <p>One or more entries to add to the prefix list.</p>
        remove_entries: <p>One or more entries to remove from the prefix list.</p>
        max_entries: <p>The maximum number of entries for the prefix list. You cannot modify the entries of a prefix list and modify the size of a prefix list at the same time.</p> <p>If any of the resources that reference the prefix list cannot support the new maximum size, the modify operation fails. Check the state message for the IDs of the first ten resources that do not support the new maximum size.</p>
        ipam_prefix_list_resolver_sync_enabled: <p>Indicates whether synchronization with an IPAM prefix list resolver should be enabled for this managed prefix list. When enabled, the prefix list CIDRs are automatically updated based on the associated resolver's CIDR selection rules.</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_managed_prefix_list_request.ModifyManagedPrefixListRequest]",
    ) -> OperationResponse[
        "capo_ec2.types.modify_managed_prefix_list_result.ModifyManagedPrefixListResult"
    ]:
        import capo_ec2._operations.amazon_ec2.modify_managed_prefix_list

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ModifyManagedPrefixList")
    )
    input_: capo_ec2.types.modify_managed_prefix_list_request.ModifyManagedPrefixListRequest = {}
    if dry_run is not None:
        input_["dry_run"] = dry_run
    if prefix_list_id is not None:
        input_["prefix_list_id"] = prefix_list_id
    if current_version is not None:
        input_["current_version"] = current_version
    if prefix_list_name is not None:
        input_["prefix_list_name"] = prefix_list_name
    if add_entries is not None:
        input_["add_entries"] = add_entries
    if remove_entries is not None:
        input_["remove_entries"] = remove_entries
    if max_entries is not None:
        input_["max_entries"] = max_entries
    if ipam_prefix_list_resolver_sync_enabled is not None:
        input_["ipam_prefix_list_resolver_sync_enabled"] = (
            ipam_prefix_list_resolver_sync_enabled
        )

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