

# Modifying an ElastiCache cluster
Modifying an ElastiCache cluster

In addition to adding or removing nodes from an ElastiCache cluster, there can be times where you need to make other changes such as adding a security group, changing the maintenance window or a parameter group.

We recommend that you have your maintenance window fall at the time of lowest usage. Thus it might need modification from time to time.

When you change a cluster's parameters, the change is applied to the cluster either immediately or after the cluster is restarted. This is true whether you change the cluster's parameter group itself or a parameter value within the cluster's parameter group. To determine when a particular parameter change is applied, see the **Changes Take Effect** section of the **Details** column in the tables for [Memcached specific parameters](ParameterGroups.Engine.md#ParameterGroups.Memcached) and [Valkey and Redis OSS parameters](ParameterGroups.Engine.md#ParameterGroups.Redis). For information on rebooting a cluster's nodes, see [Rebooting nodes](nodes.rebooting.md).

## Using the ElastiCache Amazon Web Services Management Console


**To modify a cluster**

1. Sign in to the Amazon Web Services Management Console and open the ElastiCache console at [ https://console.amazonaws.cn/elasticache/](https://console.amazonaws.cn/elasticache/).

1. From the list in the upper-right corner, choose the Amazon Region where the cluster that you want to modify is located.

1. In the navigation pane, choose the engine running on the cluster that you want to modify.

   A list of the chosen engine's clusters appears.

1. In the list of clusters, for the cluster that you want to modify, choose its name. 

1. Choose **Actions** and then choose **Modify**. 

   The **Modify Cluster** window appears.

1. In the **Modify Cluster** window, make the modifications that you want. Options include:
   + Description
   + Cluster mode - To modify cluster mode from **Disabled** to **Enabled**, you must first set the cluster mode to **Compatible**.

     Compatible mode allows your Valkey or Redis OSS clients to connect using both cluster mode enabled and cluster mode disabled. After you migrate all Valkey or Redis OSS clients to use cluster mode enabled, you can then complete cluster mode configuration and set the cluster mode to **Enabled**.
   + Engine Version Compatibility
**Important**  
You can upgrade to newer engine versions. If you upgrade major engine versions, for example from 5.0.6 to 6.0, you need to select a parameter group family that is compatible with the new engine version. For more information on doing so, see [Version Management for ElastiCache](VersionManagement.md). However, you can't downgrade to older engine versions except by deleting the existing cluster and creating it again.
   + VPC Security Group(s)
   + Parameter Group
   + Node Type
**Note**  
If the cluster is using a node type from the r6gd family, you can only choose a different node size from within that family. If you choose a node type from the r6gd family, data tiering will automatically be enabled. For more information, see [Data tiering](data-tiering.md).
   + Multi-AZ
   + Auto failover (cluster mode disabled only)
   + Enable Automatic Backups
   + Backup Node Id
   + Backup Retention Period
   + Backup Window
   + Topic for SNS Notification
   + Memcached Engine Version Compatibility
   + Network type
**Note**  
If you are switching from IPv4 to IPv6, you must select or create subnet groups compatible with IPv6. For more information, see [Choosing a network type in ElastiCache](network-type.md).
   + VPC Security Group(s)
   + Parameter Group
   + Maintenance Window
   + Topic for SNS Notification

   The **Apply Immediately** box applies only to engine version and node type modifications. To apply changes immediately, choose the **Apply Immediately** check box. If this box is not chosen, engine version modifications are applied during the next maintenance window. Other modifications, such as changing the maintenance window, are applied immediately.

**To enable/disable log delivery for Redis**

1. From the list of clusters, choose the cluster you want to modify. Choose the **Cluster name** and not the checkbox beside it.

1. On the **Cluster details** page, choose the **Logs** tab.

1. To enable or disable slow logs, choose either **Enable** or **Disable**.

   If you choose enable:

   1. Under **Log format**, choose either **JSON** or **Text**.

   1. Under **Log destination type**, choose either **CloudWatch Logs** or **Kinesis Firehose**.

   1. Under **Log destination**, you can choose **Create new** and enter either your CloudWatchLogs log group name or your Kinesis Data Firehose stream name. You can also choose **Select existing** and then choose either your CloudWatchLogs log group name or your Kinesis Data Firehose stream name.

   1. Choose **Enable**.

**To change your configuration for Redis:**

1. Choose **Modify**.

1. Under **Log format**, choose either **JSON** or **Text**.

1. Under **Destination Type**, choose either **CloudWatch Logs** or **Kinesis Firehose**.

1. Under **Log destination**, choose either **Create new** and enter your CloudWatchLogs log group name or your Kinesis Data Firehose stream name. Or choose **Select existing** and then choose your CloudWatchLogs log group name or your Kinesis Data Firehose stream name.

## Using the Amazon CLI with ElastiCache


You can modify an existing cluster using the Amazon CLI `modify-cache-cluster` operation. To modify a cluster's configuration value, specify the cluster's ID, the parameter to change and the parameter's new value. The following example changes the maintenance window for a cluster named `my-cluster` and applies the change immediately.

**Important**  
You can upgrade to newer Memcached engine versions. For more information on doing so, see [Version Management for ElastiCache](VersionManagement.md). However, you can't downgrade to older engine versions except by deleting the existing cluster and creating it again.

**Important**  
You can upgrade to newer Valkey or Redis OSS engine versions. If you upgrade major engine versions, for example from Redis OSS 5.0.6 to Redis OSS 6.0, you need to select a parameter group family that is compatible with the new engine version. For more information on doing so, see [Version Management for ElastiCache](VersionManagement.md). However, you can't downgrade to older engine versions except by deleting the existing cluster and creating it again.

For Linux, OS X, or Unix:

```
aws elasticache modify-cache-cluster \
    --cache-cluster-id my-cluster \
    --preferred-maintenance-window sun:23:00-mon:02:00
```

For Windows:

```
aws elasticache modify-cache-cluster ^
    --cache-cluster-id my-cluster ^
    --preferred-maintenance-window sun:23:00-mon:02:00
```

The `--apply-immediately` parameter applies only to modifications in node type, engine version, and changing the number of nodes in a cluster. If you want to apply any of these changes immediately, use the `--apply-immediately` parameter. If you prefer postponing these changes to your next maintenance window, use the `--no-apply-immediately` parameter. Other modifications, such as changing the maintenance window, are applied immediately.

For more information, see the Amazon CLI for ElastiCache topic [https://docs.amazonaws.cn/cli/latest/reference/elasticache/modify-cache-cluster.html](https://docs.amazonaws.cn/cli/latest/reference/elasticache/modify-cache-cluster.html).

## Using the ElastiCache API


You can modify an existing cluster using the ElastiCache API `ModifyCacheCluster` operation. To modify a cluster's configuration value, specify the cluster's ID, the parameter to change and the parameter's new value. The following example changes the maintenance window for a cluster named `my-cluster` and applies the change immediately.

**Important**  
You can upgrade to newer Memcached engine versions. For more information on doing so, see [Version Management for ElastiCache](VersionManagement.md). However, you can't downgrade to older engine versions except by deleting the existing cluster and creating it again.

**Important**  
You can upgrade to newer Valkey or Redis OSS engine versions. If you upgrade major engine versions, for example from Redis OSS 5.0.6 to Redis OSS 6.0, you need to select a parameter group family that is compatible with the new engine version. For more information on doing so, see [Version Management for ElastiCache](VersionManagement.md). However, you can't downgrade to older engine versions except by deleting the existing cluster and creating it again.

Line breaks are added for ease of reading.

```
https://elasticache.us-west-2.amazonaws.com/
    ?Action=ModifyCacheCluster
    &CacheClusterId=my-cluster
    &PreferredMaintenanceWindow=sun:23:00-mon:02:00
    &SignatureVersion=4
    &SignatureMethod=HmacSHA256
    &Timestamp=20150901T220302Z
    &X-Amz-Algorithm=&AWS;4-HMAC-SHA256
    &X-Amz-Date=20150202T220302Z
    &X-Amz-SignedHeaders=Host
    &X-Amz-Expires=20150901T220302Z
    &X-Amz-Credential=<credential>
    &X-Amz-Signature=<signature>
```

The `ApplyImmediately` parameter applies only to modifications in node type, engine version, and changing the number of nodes in a cluster. If you want to apply any of these changes immediately, set the `ApplyImmediately` parameter to `true`. If you prefer postponing these changes to your next maintenance window, set the `ApplyImmediately` parameter to `false`. Other modifications, such as changing the maintenance window, are applied immediately.

For more information, see the ElastiCache API reference topic [https://docs.amazonaws.cn/AmazonElastiCache/latest/APIReference/API_ModifyCacheCluster.html](https://docs.amazonaws.cn/AmazonElastiCache/latest/APIReference/API_ModifyCacheCluster.html).