Skip to content

modify_cache_cluster

modify_cache_cluster(
    *,
    config_overrides: Optional[ElastiCacheClientConfig] = None,
    cache_cluster_id: Optional[String] = None,
    num_cache_nodes: Optional[IntegerOptional] = None,
    cache_node_ids_to_remove: Optional[CacheNodeIdsList] = None,
    az_mode: Optional[AZMode] = None,
    new_availability_zones: Optional[PreferredAvailabilityZoneList] = None,
    cache_security_group_names: Optional[CacheSecurityGroupNameList] = None,
    security_group_ids: Optional[SecurityGroupIdsList] = None,
    preferred_maintenance_window: Optional[String] = None,
    notification_topic_arn: Optional[String] = None,
    cache_parameter_group_name: Optional[String] = None,
    notification_topic_status: Optional[String] = None,
    apply_immediately: Optional[Boolean] = None,
    engine: Optional[String] = None,
    engine_version: Optional[String] = None,
    auto_minor_version_upgrade: Optional[BooleanOptional] = None,
    snapshot_retention_limit: Optional[IntegerOptional] = None,
    snapshot_window: Optional[String] = None,
    cache_node_type: Optional[String] = None,
    auth_token: Optional[String] = None,
    auth_token_update_strategy: Optional[AuthTokenUpdateStrategyType] = None,
    log_delivery_configurations: Optional[LogDeliveryConfigurationRequestList] = None,
    ip_discovery: Optional[IpDiscovery] = None,
    scale_config: Optional[ScaleConfig] = None,
) -> ModifyCacheClusterResult

Modifies the settings for a cluster. You can use this operation to change one or more cluster configuration parameters by specifying the parameters and the new values.

Parameters:

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

    The cluster identifier. This value is stored as a lowercase string.

  • num_cache_nodes (Optional[IntegerOptional], default: None ) –

    The number of cache nodes that the cluster should have. If the value for NumCacheNodes is greater than the sum of the number of current cache nodes and the number of cache nodes pending creation (which may be zero), more nodes are added. If the value is less than the number of existing cache nodes, nodes are removed. If the value is equal to the number of current cache nodes, any pending add or remove requests are canceled.

    If you are removing cache nodes, you must use the CacheNodeIdsToRemove parameter to provide the IDs of the specific cache nodes to remove.

    For clusters running Valkey or Redis OSS, this value must be 1. For clusters running Memcached, this value must be between 1 and 40.

    Adding or removing Memcached cache nodes can be applied immediately or as a pending operation (see ApplyImmediately).

    A pending operation to modify the number of cache nodes in a cluster during its maintenance window, whether by adding or removing nodes in accordance with the scale out architecture, is not queued. The customer's latest request to add or remove nodes to the cluster overrides any previous pending operations to modify the number of cache nodes in the cluster. For example, a request to remove 2 nodes would override a previous pending operation to remove 3 nodes. Similarly, a request to add 2 nodes would override a previous pending operation to remove 3 nodes and vice versa. As Memcached cache nodes may now be provisioned in different Availability Zones with flexible cache node placement, a request to add nodes does not automatically override a previous pending operation to add nodes. The customer can modify the previous pending operation to add more nodes or explicitly cancel the pending request and retry the new request. To cancel pending operations to modify the number of cache nodes in a cluster, use the ModifyCacheCluster request and set NumCacheNodes equal to the number of cache nodes currently in the cluster.

  • cache_node_ids_to_remove (Optional[CacheNodeIdsList], default: None ) –

    A list of cache node IDs to be removed. A node ID is a numeric identifier (0001, 0002, etc.). This parameter is only valid when NumCacheNodes is less than the existing number of cache nodes. The number of cache node IDs supplied in this parameter must match the difference between the existing number of cache nodes in the cluster or pending cache nodes, whichever is greater, and the value of NumCacheNodes in the request.

    For example: If you have 3 active cache nodes, 7 pending cache nodes, and the number of cache nodes in this ModifyCacheCluster call is 5, you must list 2 (7 - 5) cache node IDs to remove.

  • az_mode (Optional[AZMode], default: None ) –

    Specifies whether the new nodes in this Memcached cluster are all created in a single Availability Zone or created across multiple Availability Zones.

    Valid values: single-az | cross-az.

    This option is only supported for Memcached clusters.

    You cannot specify single-az if the Memcached cluster already has cache nodes in different Availability Zones. If cross-az is specified, existing Memcached nodes remain in their current Availability Zone.

    Only newly created nodes are located in different Availability Zones.

  • new_availability_zones (Optional[PreferredAvailabilityZoneList], default: None ) –

    This option is only supported on Memcached clusters.

    The list of Availability Zones where the new Memcached cache nodes are created.

    This parameter is only valid when NumCacheNodes in the request is greater than the sum of the number of active cache nodes and the number of cache nodes pending creation (which may be zero). The number of Availability Zones supplied in this list must match the cache nodes being added in this request.

    Scenarios:

    • Scenario 1: You have 3 active nodes and wish to add 2 nodes. Specify NumCacheNodes=5 (3 + 2) and optionally specify two Availability Zones for the two new nodes.

    • Scenario 2: You have 3 active nodes and 2 nodes pending creation (from the scenario 1 call) and want to add 1 more node. Specify NumCacheNodes=6 ((3 + 2) + 1) and optionally specify an Availability Zone for the new node.

    • Scenario 3: You want to cancel all pending operations. Specify NumCacheNodes=3 to cancel all pending operations.

    The Availability Zone placement of nodes pending creation cannot be modified. If you wish to cancel any nodes pending creation, add 0 nodes by setting NumCacheNodes to the number of current nodes.

    If cross-az is specified, existing Memcached nodes remain in their current Availability Zone. Only newly created nodes can be located in different Availability Zones. For guidance on how to move existing Memcached nodes to different Availability Zones, see the Availability Zone Considerations section of Cache Node Considerations for Memcached.

    Impact of new add/remove requests upon pending requests

    • Scenario-1

      • Pending Action: Delete

      • New Request: Delete

      • Result: The new delete, pending or immediate, replaces the pending delete.

    • Scenario-2

      • Pending Action: Delete

      • New Request: Create

      • Result: The new create, pending or immediate, replaces the pending delete.

    • Scenario-3

      • Pending Action: Create

      • New Request: Delete

      • Result: The new delete, pending or immediate, replaces the pending create.

    • Scenario-4

      • Pending Action: Create

      • New Request: Create

      • Result: The new create is added to the pending create.

        Important: If the new create request is Apply Immediately - Yes, all creates are performed immediately. If the new create request is Apply Immediately - No, all creates are pending.

  • cache_security_group_names (Optional[CacheSecurityGroupNameList], default: None ) –

    A list of cache security group names to authorize on this cluster. This change is asynchronously applied as soon as possible.

    You can use this parameter only with clusters that are created outside of an Amazon Virtual Private Cloud (Amazon VPC).

    Constraints: Must contain no more than 255 alphanumeric characters. Must not be "Default".

  • security_group_ids (Optional[SecurityGroupIdsList], default: None ) –

    Specifies the VPC Security Groups associated with the cluster.

    This parameter can be used only with clusters that are created in an Amazon Virtual Private Cloud (Amazon VPC).

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

    Specifies the weekly time range during which maintenance on the cluster is performed. It is specified as a range in the format ddd:hh24:mi-ddd:hh24:mi (24H Clock UTC). The minimum maintenance window is a 60 minute period.

    Valid values for ddd are:

    • sun

    • mon

    • tue

    • wed

    • thu

    • fri

    • sat

    Example: sun:23:00-mon:01:30

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

    The Amazon Resource Name (ARN) of the Amazon SNS topic to which notifications are sent.

    The Amazon SNS topic owner must be same as the cluster owner.

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

    The name of the cache parameter group to apply to this cluster. This change is asynchronously applied as soon as possible for parameters when the ApplyImmediately parameter is specified as true for this request.

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

    The status of the Amazon SNS notification topic. Notifications are sent only if the status is active.

    Valid values: active | inactive

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

    If true, this parameter causes the modifications in this request and any pending modifications to be applied, asynchronously and as soon as possible, regardless of the PreferredMaintenanceWindow setting for the cluster.

    If false, changes to the cluster are applied on the next maintenance reboot, or the next failure reboot, whichever occurs first.

    If you perform a ModifyCacheCluster before a pending modification is applied, the pending modification is replaced by the newer modification. However, a pending node-count increase on Memcached clusters cannot be superseded by a request to add fewer nodes. To change a pending node addition, first cancel it by setting NumCacheNodes equal to the current number of nodes in the cluster, then submit the new request. See the NumCacheNodes parameter for details on node scaling behavior.

    Valid values: true | false

    Default: false

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

    The engine type used by the cache cluster. The options are valkey, memcached or redis.

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

    The upgraded version of the cache engine to be run on the cache nodes.

    Important: You can upgrade to a newer engine version (see Selecting a Cache Engine and Version), but you cannot downgrade to an earlier engine version. If you want to use an earlier engine version, you must delete the existing cluster and create it anew with the earlier engine version.

  • auto_minor_version_upgrade (Optional[BooleanOptional], default: None ) –

    If you are running Valkey 7.2 or Redis OSS engine version 6.0 or later, set this parameter to yes to opt-in to the next auto minor version upgrade campaign. This parameter is disabled for previous versions.

  • snapshot_retention_limit (Optional[IntegerOptional], default: None ) –

    The number of days for which ElastiCache retains automatic cluster snapshots before deleting them. For example, if you set SnapshotRetentionLimit to 5, a snapshot that was taken today is retained for 5 days before being deleted.

    If the value of SnapshotRetentionLimit is set to zero (0), backups are turned off.

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

    The daily time range (in UTC) during which ElastiCache begins taking a daily snapshot of your cluster.

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

    A valid cache node type that you want to scale this cluster up to.

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

    Reserved parameter. The password used to access a password protected server. This parameter must be specified with the auth-token-update parameter. Password constraints:

    • Must be only printable ASCII characters

    • Must be at least 16 characters and no more than 128 characters in length

    • Cannot contain any of the following characters: '/', '"', or '@', '%'

    For more information, see AUTH password at AUTH.

  • auth_token_update_strategy (Optional[AuthTokenUpdateStrategyType], default: None ) –

    Specifies the strategy to use to update the AUTH token. This parameter must be specified with the auth-token parameter. Possible values:

    • ROTATE - default, if no update strategy is provided

    • SET - allowed only after ROTATE

    • DELETE - allowed only when transitioning to RBAC

    For more information, see Authenticating Users with AUTH

  • log_delivery_configurations (Optional[LogDeliveryConfigurationRequestList], default: None ) –

    Specifies the destination, format and type of the logs.

  • ip_discovery (Optional[IpDiscovery], default: None ) –

    The network type you choose when modifying a cluster, either ipv4 | ipv6. IPv6 is supported for workloads using Valkey 7.2 and above, Redis OSS engine version 6.2 to 7.1 or Memcached engine version 1.6.6 and above on all instances built on the Nitro system.

  • scale_config (Optional[ScaleConfig], default: None ) –

    Configures horizontal or vertical scaling for Memcached clusters, specifying the scaling percentage and interval.

Raises:

Examples:

ModifyCacheCluster Copies a snapshot to a specified name.

>>> client.modify_cache_cluster(cache_cluster_id='redis-cluster', apply_immediately=True, snapshot_retention_limit=14)
Source code in docs_src/capo_elasticache/_services/elasti_cache.py
def modify_cache_cluster(
    self,
    *,
    config_overrides: Optional[ElastiCacheClientConfig] = None,
    cache_cluster_id: Optional["capo_elasticache.types.string.String"] = None,
    num_cache_nodes: Optional[
        "capo_elasticache.types.integer_optional.IntegerOptional"
    ] = None,
    cache_node_ids_to_remove: Optional[
        "capo_elasticache.types.cache_node_ids_list.CacheNodeIdsList"
    ] = None,
    az_mode: Optional["capo_elasticache.types.az_mode.AZMode"] = None,
    new_availability_zones: Optional[
        "capo_elasticache.types.preferred_availability_zone_list.PreferredAvailabilityZoneList"
    ] = None,
    cache_security_group_names: Optional[
        "capo_elasticache.types.cache_security_group_name_list.CacheSecurityGroupNameList"
    ] = None,
    security_group_ids: Optional[
        "capo_elasticache.types.security_group_ids_list.SecurityGroupIdsList"
    ] = None,
    preferred_maintenance_window: Optional[
        "capo_elasticache.types.string.String"
    ] = None,
    notification_topic_arn: Optional["capo_elasticache.types.string.String"] = None,
    cache_parameter_group_name: Optional[
        "capo_elasticache.types.string.String"
    ] = None,
    notification_topic_status: Optional[
        "capo_elasticache.types.string.String"
    ] = None,
    apply_immediately: Optional["capo_elasticache.types.boolean.Boolean"] = None,
    engine: Optional["capo_elasticache.types.string.String"] = None,
    engine_version: Optional["capo_elasticache.types.string.String"] = None,
    auto_minor_version_upgrade: Optional[
        "capo_elasticache.types.boolean_optional.BooleanOptional"
    ] = None,
    snapshot_retention_limit: Optional[
        "capo_elasticache.types.integer_optional.IntegerOptional"
    ] = None,
    snapshot_window: Optional["capo_elasticache.types.string.String"] = None,
    cache_node_type: Optional["capo_elasticache.types.string.String"] = None,
    auth_token: Optional["capo_elasticache.types.string.String"] = None,
    auth_token_update_strategy: Optional[
        "capo_elasticache.types.auth_token_update_strategy_type.AuthTokenUpdateStrategyType"
    ] = None,
    log_delivery_configurations: Optional[
        "capo_elasticache.types.log_delivery_configuration_request_list.LogDeliveryConfigurationRequestList"
    ] = None,
    ip_discovery: Optional[
        "capo_elasticache.types.ip_discovery.IpDiscovery"
    ] = None,
    scale_config: Optional[
        "capo_elasticache.types.scale_config.ScaleConfig"
    ] = None,
) -> "capo_elasticache.types.modify_cache_cluster_result.ModifyCacheClusterResult":
    """<p>Modifies the settings for a cluster. You can use this operation to change one or more cluster configuration parameters by specifying the parameters and the new values.</p>

    Args:
        cache_cluster_id: <p>The cluster identifier. This value is stored as a lowercase string.</p>
        num_cache_nodes: <p>The number of cache nodes that the cluster should have. If the value for <code>NumCacheNodes</code> is greater than the sum of the number of current cache nodes and the number of cache nodes pending creation (which may be zero), more nodes are added. If the value is less than the number of existing cache nodes, nodes are removed. If the value is equal to the number of current cache nodes, any pending add or remove requests are canceled.</p> <p>If you are removing cache nodes, you must use the <code>CacheNodeIdsToRemove</code> parameter to provide the IDs of the specific cache nodes to remove.</p> <p>For clusters running Valkey or Redis OSS, this value must be 1. For clusters running Memcached, this value must be between 1 and 40.</p> <note> <p>Adding or removing Memcached cache nodes can be applied immediately or as a pending operation (see <code>ApplyImmediately</code>).</p> <p>A pending operation to modify the number of cache nodes in a cluster during its maintenance window, whether by adding or removing nodes in accordance with the scale out architecture, is not queued. The customer's latest request to add or remove nodes to the cluster overrides any previous pending operations to modify the number of cache nodes in the cluster. For example, a request to remove 2 nodes would override a previous pending operation to remove 3 nodes. Similarly, a request to add 2 nodes would override a previous pending operation to remove 3 nodes and vice versa. As Memcached cache nodes may now be provisioned in different Availability Zones with flexible cache node placement, a request to add nodes does not automatically override a previous pending operation to add nodes. The customer can modify the previous pending operation to add more nodes or explicitly cancel the pending request and retry the new request. To cancel pending operations to modify the number of cache nodes in a cluster, use the <code>ModifyCacheCluster</code> request and set <code>NumCacheNodes</code> equal to the number of cache nodes currently in the cluster.</p> </note>
        cache_node_ids_to_remove: <p>A list of cache node IDs to be removed. A node ID is a numeric identifier (0001, 0002, etc.). This parameter is only valid when <code>NumCacheNodes</code> is less than the existing number of cache nodes. The number of cache node IDs supplied in this parameter must match the difference between the existing number of cache nodes in the cluster or pending cache nodes, whichever is greater, and the value of <code>NumCacheNodes</code> in the request.</p> <p>For example: If you have 3 active cache nodes, 7 pending cache nodes, and the number of cache nodes in this <code>ModifyCacheCluster</code> call is 5, you must list 2 (7 - 5) cache node IDs to remove.</p>
        az_mode: <p>Specifies whether the new nodes in this Memcached cluster are all created in a single Availability Zone or created across multiple Availability Zones.</p> <p>Valid values: <code>single-az</code> | <code>cross-az</code>.</p> <p>This option is only supported for Memcached clusters.</p> <note> <p>You cannot specify <code>single-az</code> if the Memcached cluster already has cache nodes in different Availability Zones. If <code>cross-az</code> is specified, existing Memcached nodes remain in their current Availability Zone.</p> <p>Only newly created nodes are located in different Availability Zones. </p> </note>
        new_availability_zones: <note> <p>This option is only supported on Memcached clusters.</p> </note> <p>The list of Availability Zones where the new Memcached cache nodes are created.</p> <p>This parameter is only valid when <code>NumCacheNodes</code> in the request is greater than the sum of the number of active cache nodes and the number of cache nodes pending creation (which may be zero). The number of Availability Zones supplied in this list must match the cache nodes being added in this request.</p> <p>Scenarios:</p> <ul> <li> <p> <b>Scenario 1:</b> You have 3 active nodes and wish to add 2 nodes. Specify <code>NumCacheNodes=5</code> (3 + 2) and optionally specify two Availability Zones for the two new nodes.</p> </li> <li> <p> <b>Scenario 2:</b> You have 3 active nodes and 2 nodes pending creation (from the scenario 1 call) and want to add 1 more node. Specify <code>NumCacheNodes=6</code> ((3 + 2) + 1) and optionally specify an Availability Zone for the new node.</p> </li> <li> <p> <b>Scenario 3:</b> You want to cancel all pending operations. Specify <code>NumCacheNodes=3</code> to cancel all pending operations.</p> </li> </ul> <p>The Availability Zone placement of nodes pending creation cannot be modified. If you wish to cancel any nodes pending creation, add 0 nodes by setting <code>NumCacheNodes</code> to the number of current nodes.</p> <p>If <code>cross-az</code> is specified, existing Memcached nodes remain in their current Availability Zone. Only newly created nodes can be located in different Availability Zones. For guidance on how to move existing Memcached nodes to different Availability Zones, see the <b>Availability Zone Considerations</b> section of <a href="https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/CacheNodes.SupportedTypes.html">Cache Node Considerations for Memcached</a>.</p> <p> <b>Impact of new add/remove requests upon pending requests</b> </p> <ul> <li> <p>Scenario-1</p> <ul> <li> <p>Pending Action: Delete</p> </li> <li> <p>New Request: Delete</p> </li> <li> <p>Result: The new delete, pending or immediate, replaces the pending delete.</p> </li> </ul> </li> <li> <p>Scenario-2</p> <ul> <li> <p>Pending Action: Delete</p> </li> <li> <p>New Request: Create</p> </li> <li> <p>Result: The new create, pending or immediate, replaces the pending delete.</p> </li> </ul> </li> <li> <p>Scenario-3</p> <ul> <li> <p>Pending Action: Create</p> </li> <li> <p>New Request: Delete</p> </li> <li> <p>Result: The new delete, pending or immediate, replaces the pending create.</p> </li> </ul> </li> <li> <p>Scenario-4</p> <ul> <li> <p>Pending Action: Create</p> </li> <li> <p>New Request: Create</p> </li> <li> <p>Result: The new create is added to the pending create.</p> <important> <p> <b>Important:</b> If the new create request is <b>Apply Immediately - Yes</b>, all creates are performed immediately. If the new create request is <b>Apply Immediately - No</b>, all creates are pending.</p> </important> </li> </ul> </li> </ul>
        cache_security_group_names: <p>A list of cache security group names to authorize on this cluster. This change is asynchronously applied as soon as possible.</p> <p>You can use this parameter only with clusters that are created outside of an Amazon Virtual Private Cloud (Amazon VPC).</p> <p>Constraints: Must contain no more than 255 alphanumeric characters. Must not be "Default".</p>
        security_group_ids: <p>Specifies the VPC Security Groups associated with the cluster.</p> <p>This parameter can be used only with clusters that are created in an Amazon Virtual Private Cloud (Amazon VPC).</p>
        preferred_maintenance_window: <p>Specifies the weekly time range during which maintenance on the cluster is performed. It is specified as a range in the format ddd:hh24:mi-ddd:hh24:mi (24H Clock UTC). The minimum maintenance window is a 60 minute period.</p> <p>Valid values for <code>ddd</code> are:</p> <ul> <li> <p> <code>sun</code> </p> </li> <li> <p> <code>mon</code> </p> </li> <li> <p> <code>tue</code> </p> </li> <li> <p> <code>wed</code> </p> </li> <li> <p> <code>thu</code> </p> </li> <li> <p> <code>fri</code> </p> </li> <li> <p> <code>sat</code> </p> </li> </ul> <p>Example: <code>sun:23:00-mon:01:30</code> </p>
        notification_topic_arn: <p>The Amazon Resource Name (ARN) of the Amazon SNS topic to which notifications are sent.</p> <note> <p>The Amazon SNS topic owner must be same as the cluster owner.</p> </note>
        cache_parameter_group_name: <p>The name of the cache parameter group to apply to this cluster. This change is asynchronously applied as soon as possible for parameters when the <code>ApplyImmediately</code> parameter is specified as <code>true</code> for this request.</p>
        notification_topic_status: <p>The status of the Amazon SNS notification topic. Notifications are sent only if the status is <code>active</code>.</p> <p>Valid values: <code>active</code> | <code>inactive</code> </p>
        apply_immediately: <p>If <code>true</code>, this parameter causes the modifications in this request and any pending modifications to be applied, asynchronously and as soon as possible, regardless of the <code>PreferredMaintenanceWindow</code> setting for the cluster.</p> <p>If <code>false</code>, changes to the cluster are applied on the next maintenance reboot, or the next failure reboot, whichever occurs first.</p> <important> <p>If you perform a <code>ModifyCacheCluster</code> before a pending modification is applied, the pending modification is replaced by the newer modification. However, a pending node-count increase on Memcached clusters cannot be superseded by a request to add fewer nodes. To change a pending node addition, first cancel it by setting <code>NumCacheNodes</code> equal to the current number of nodes in the cluster, then submit the new request. See the <code>NumCacheNodes</code> parameter for details on node scaling behavior.</p> </important> <p>Valid values: <code>true</code> | <code>false</code> </p> <p>Default: <code>false</code> </p>
        engine: <p>The engine type used by the cache cluster. The options are valkey, memcached or redis.</p>
        engine_version: <p>The upgraded version of the cache engine to be run on the cache nodes.</p> <p> <b>Important:</b> You can upgrade to a newer engine version (see <a href="https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/SelectEngine.html#VersionManagement">Selecting a Cache Engine and Version</a>), but you cannot downgrade to an earlier engine version. If you want to use an earlier engine version, you must delete the existing cluster and create it anew with the earlier engine version. </p>
        auto_minor_version_upgrade: <p> If you are running Valkey 7.2 or Redis OSS engine version 6.0 or later, set this parameter to yes to opt-in to the next auto minor version upgrade campaign. This parameter is disabled for previous versions. </p>
        snapshot_retention_limit: <p>The number of days for which ElastiCache retains automatic cluster snapshots before deleting them. For example, if you set <code>SnapshotRetentionLimit</code> to 5, a snapshot that was taken today is retained for 5 days before being deleted.</p> <note> <p>If the value of <code>SnapshotRetentionLimit</code> is set to zero (0), backups are turned off.</p> </note>
        snapshot_window: <p>The daily time range (in UTC) during which ElastiCache begins taking a daily snapshot of your cluster. </p>
        cache_node_type: <p>A valid cache node type that you want to scale this cluster up to.</p>
        auth_token: <p>Reserved parameter. The password used to access a password protected server. This parameter must be specified with the <code>auth-token-update</code> parameter. Password constraints:</p> <ul> <li> <p>Must be only printable ASCII characters</p> </li> <li> <p>Must be at least 16 characters and no more than 128 characters in length</p> </li> <li> <p>Cannot contain any of the following characters: '/', '"', or '@', '%'</p> </li> </ul> <p> For more information, see AUTH password at <a href="http://redis.io/commands/AUTH">AUTH</a>.</p>
        auth_token_update_strategy: <p>Specifies the strategy to use to update the AUTH token. This parameter must be specified with the <code>auth-token</code> parameter. Possible values:</p> <ul> <li> <p>ROTATE - default, if no update strategy is provided</p> </li> <li> <p>SET - allowed only after ROTATE</p> </li> <li> <p>DELETE - allowed only when transitioning to RBAC</p> </li> </ul> <p> For more information, see <a href="http://docs.aws.amazon.com/AmazonElastiCache/latest/dg/auth.html">Authenticating Users with AUTH</a> </p>
        log_delivery_configurations: <p>Specifies the destination, format and type of the logs.</p>
        ip_discovery: <p>The network type you choose when modifying a cluster, either <code>ipv4</code> | <code>ipv6</code>. IPv6 is supported for workloads using Valkey 7.2 and above, Redis OSS engine version 6.2 to 7.1 or Memcached engine version 1.6.6 and above on all instances built on the <a href="http://aws.amazon.com/ec2/nitro/">Nitro system</a>.</p>
        scale_config: <p>Configures horizontal or vertical scaling for Memcached clusters, specifying the scaling percentage and interval.</p>

    Raises:
        capo_elasticache.errors.cache_cluster_not_found_fault.CacheClusterNotFoundFault: <p>The requested cluster ID does not refer to an existing cluster.</p>
        capo_elasticache.errors.cache_parameter_group_not_found_fault.CacheParameterGroupNotFoundFault: <p>The requested cache parameter group name does not refer to an existing cache parameter group.</p>
        capo_elasticache.errors.cache_security_group_not_found_fault.CacheSecurityGroupNotFoundFault: <p>The requested cache security group name does not refer to an existing cache security group.</p>
        capo_elasticache.errors.insufficient_cache_cluster_capacity_fault.InsufficientCacheClusterCapacityFault: <p>The requested cache node type is not available in the specified Availability Zone. For more information, see <a href="http://docs.aws.amazon.com/AmazonElastiCache/latest/dg/ErrorMessages.html#ErrorMessages.INSUFFICIENT_CACHE_CLUSTER_CAPACITY">InsufficientCacheClusterCapacity</a> in the ElastiCache User Guide.</p>
        capo_elasticache.errors.invalid_cache_cluster_state_fault.InvalidCacheClusterStateFault: <p>The requested cluster is not in the <code>available</code> state.</p>
        capo_elasticache.errors.invalid_cache_security_group_state_fault.InvalidCacheSecurityGroupStateFault: <p>The current state of the cache security group does not allow deletion.</p>
        capo_elasticache.errors.invalid_parameter_combination_exception.InvalidParameterCombinationException: <p>Two or more incompatible parameters were specified.</p>
        capo_elasticache.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>The value for a parameter is invalid.</p>
        capo_elasticache.errors.invalid_vpc_network_state_fault.InvalidVPCNetworkStateFault: <p>The VPC network is in an invalid state.</p>
        capo_elasticache.errors.node_quota_for_cluster_exceeded_fault.NodeQuotaForClusterExceededFault: <p>The request cannot be processed because it would exceed the allowed number of cache nodes in a single cluster.</p>
        capo_elasticache.errors.node_quota_for_customer_exceeded_fault.NodeQuotaForCustomerExceededFault: <p>The request cannot be processed because it would exceed the allowed number of cache nodes per customer.</p>
        capo_elasticache.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        ModifyCacheCluster
        Copies a snapshot to a specified name.

        >>> client.modify_cache_cluster(cache_cluster_id='redis-cluster', apply_immediately=True, snapshot_retention_limit=14)
    """

    def _handler(
        req: "OperationRequest[capo_elasticache.types.modify_cache_cluster_message.ModifyCacheClusterMessage]",
    ) -> OperationResponse[
        "capo_elasticache.types.modify_cache_cluster_result.ModifyCacheClusterResult"
    ]:
        import capo_elasticache._operations.amazon_elasti_cache_v9.modify_cache_cluster

        output, http_response = (
            capo_elasticache._operations.amazon_elasti_cache_v9.modify_cache_cluster.modify_cache_cluster(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ModifyCacheCluster")
    )
    input_: capo_elasticache.types.modify_cache_cluster_message.ModifyCacheClusterMessage = {}
    if cache_cluster_id is not None:
        input_["cache_cluster_id"] = cache_cluster_id
    if num_cache_nodes is not None:
        input_["num_cache_nodes"] = num_cache_nodes
    if cache_node_ids_to_remove is not None:
        input_["cache_node_ids_to_remove"] = cache_node_ids_to_remove
    if az_mode is not None:
        input_["az_mode"] = az_mode
    if new_availability_zones is not None:
        input_["new_availability_zones"] = new_availability_zones
    if cache_security_group_names is not None:
        input_["cache_security_group_names"] = cache_security_group_names
    if security_group_ids is not None:
        input_["security_group_ids"] = security_group_ids
    if preferred_maintenance_window is not None:
        input_["preferred_maintenance_window"] = preferred_maintenance_window
    if notification_topic_arn is not None:
        input_["notification_topic_arn"] = notification_topic_arn
    if cache_parameter_group_name is not None:
        input_["cache_parameter_group_name"] = cache_parameter_group_name
    if notification_topic_status is not None:
        input_["notification_topic_status"] = notification_topic_status
    if apply_immediately is not None:
        input_["apply_immediately"] = apply_immediately
    if engine is not None:
        input_["engine"] = engine
    if engine_version is not None:
        input_["engine_version"] = engine_version
    if auto_minor_version_upgrade is not None:
        input_["auto_minor_version_upgrade"] = auto_minor_version_upgrade
    if snapshot_retention_limit is not None:
        input_["snapshot_retention_limit"] = snapshot_retention_limit
    if snapshot_window is not None:
        input_["snapshot_window"] = snapshot_window
    if cache_node_type is not None:
        input_["cache_node_type"] = cache_node_type
    if auth_token is not None:
        input_["auth_token"] = auth_token
    if auth_token_update_strategy is not None:
        input_["auth_token_update_strategy"] = auth_token_update_strategy
    if log_delivery_configurations is not None:
        input_["log_delivery_configurations"] = log_delivery_configurations
    if ip_discovery is not None:
        input_["ip_discovery"] = ip_discovery
    if scale_config is not None:
        input_["scale_config"] = scale_config

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