Note:

You are viewing the documentation for an older major version of the AWS CLI (version 1).

AWS CLI version 2, the latest major version of AWS CLI, is now stable and recommended for general use. To view this page for the AWS CLI version 2, click here. For more information see the AWS CLI version 2 installation instructions and migration guide.

[ aws . elasticache ]

modify-replication-group-shard-configuration

Description

Modifies a replication group's shards (node groups) by allowing you to add shards, remove shards, or rebalance the keyspaces among existing shards.

See also: AWS API Documentation

Synopsis

  modify-replication-group-shard-configuration
--replication-group-id <value>
--node-group-count <value>
--apply-immediately | --no-apply-immediately
[--resharding-configuration <value>]
[--node-groups-to-remove <value>]
[--node-groups-to-retain <value>]
[--cli-input-json <value>]
[--generate-cli-skeleton <value>]
[--debug]
[--endpoint-url <value>]
[--no-verify-ssl]
[--no-paginate]
[--output <value>]
[--query <value>]
[--profile <value>]
[--region <value>]
[--version <value>]
[--color <value>]
[--no-sign-request]
[--ca-bundle <value>]
[--cli-read-timeout <value>]
[--cli-connect-timeout <value>]

Options

--replication-group-id (string)

The name of the Valkey or Redis OSS (cluster mode enabled) cluster (replication group) on which the shards are to be configured.

--node-group-count (integer)

The number of node groups (shards) that results from the modification of the shard configuration.

--apply-immediately | --no-apply-immediately (boolean)

Indicates that the shard reconfiguration process begins immediately. At present, the only permitted value for this parameter is true .

Value: true

--resharding-configuration (list)

Specifies the preferred availability zones for each node group in the cluster. If the value of NodeGroupCount is greater than the current number of node groups (shards), you can use this parameter to specify the preferred availability zones of the cluster's shards. If you omit this parameter ElastiCache selects availability zones for you.

You can specify this parameter only if the value of NodeGroupCount is greater than the current number of node groups (shards).

(structure)

A list of PreferredAvailabilityZones objects that specifies the configuration of a node group in the resharded cluster.

NodeGroupId -> (string)

Either the ElastiCache supplied 4-digit id or a user supplied id for the node group these configuration values apply to.

PreferredAvailabilityZones -> (list)

A list of preferred availability zones for the nodes in this cluster.

(string)

Shorthand Syntax:

NodeGroupId=string,PreferredAvailabilityZones=string,string ...

JSON Syntax:

[
  {
    "NodeGroupId": "string",
    "PreferredAvailabilityZones": ["string", ...]
  }
  ...
]

--node-groups-to-remove (list)

If the value of NodeGroupCount is less than the current number of node groups (shards), then either NodeGroupsToRemove or NodeGroupsToRetain is required. NodeGroupsToRemove is a list of NodeGroupId s to remove from the cluster.

ElastiCache will attempt to remove all node groups listed by NodeGroupsToRemove from the cluster.

(string)

Syntax:

"string" "string" ...

--node-groups-to-retain (list)

If the value of NodeGroupCount is less than the current number of node groups (shards), then either NodeGroupsToRemove or NodeGroupsToRetain is required. NodeGroupsToRetain is a list of NodeGroupId s to retain in the cluster.

ElastiCache will attempt to remove all node groups except those listed by NodeGroupsToRetain from the cluster.

(string)

Syntax:

"string" "string" ...

--cli-input-json (string) Performs service operation based on the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton. If other arguments are provided on the command line, the CLI values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally.

--generate-cli-skeleton (string) Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input, prints a sample input JSON that can be used as an argument for --cli-input-json. If provided with the value output, it validates the command inputs and returns a sample output JSON for that command.

Global Options

--debug (boolean)

Turn on debug logging.

--endpoint-url (string)

Override command's default URL with the given URL.

--no-verify-ssl (boolean)

By default, the AWS CLI uses SSL when communicating with AWS services. For each SSL connection, the AWS CLI will verify SSL certificates. This option overrides the default behavior of verifying SSL certificates.

--no-paginate (boolean)

Disable automatic pagination. If automatic pagination is disabled, the AWS CLI will only make one call, for the first page of results.

--output (string)

The formatting style for command output.

  • json
  • text
  • table

--query (string)

A JMESPath query to use in filtering the response data.

--profile (string)

Use a specific profile from your credential file.

--region (string)

The region to use. Overrides config/env settings.

--version (string)

Display the version of this tool.

--color (string)

Turn on/off color output.

  • on
  • off
  • auto

--no-sign-request (boolean)

Do not sign requests. Credentials will not be loaded if this argument is provided.

--ca-bundle (string)

The CA certificate bundle to use when verifying SSL certificates. Overrides config/env settings.

--cli-read-timeout (int)

The maximum socket read time in seconds. If the value is set to 0, the socket read will be blocking and not timeout. The default value is 60 seconds.

--cli-connect-timeout (int)

The maximum socket connect time in seconds. If the value is set to 0, the socket connect will be blocking and not timeout. The default value is 60 seconds.

Examples

Note

To use the following examples, you must have the AWS CLI installed and configured. See the Getting started guide in the AWS CLI User Guide for more information.

Unless otherwise stated, all examples have unix-like quotation rules. These examples will need to be adapted to your terminal's quoting rules. See Using quotation marks with strings in the AWS CLI User Guide .

To modify a replication group shard configuration

The following modify-replication-group-shard-configuration decreases the node group count using the Redis engine.

aws elasticache modify-replication-group-shard-configuration \
    --replication-group-id mycluster \
    --node-group-count 3 \
    --apply-immediately \
    --node-groups-to-remove 0002

Output

{
    "ReplicationGroup": {
        "ReplicationGroupId": "mycluster",
        "Description": "mycluster",
        "GlobalReplicationGroupInfo": {},
        "Status": "modifying",
        "PendingModifiedValues": {},
        "MemberClusters": [
            "mycluster-0002-001",
            "mycluster-0002-002",
            "mycluster-0002-003",
            "mycluster-0003-001",
            "mycluster-0003-002",
            "mycluster-0003-003",
            "mycluster-0003-004",
            "mycluster-0004-001",
            "mycluster-0004-002",
            "mycluster-0004-003",
            "mycluster-0005-001",
            "mycluster-0005-002",
            "mycluster-0005-003"
        ],
        "NodeGroups": [
            {
                "NodeGroupId": "0002",
                "Status": "modifying",
                "Slots": "894-1767,3134-4443,5149-5461,6827-7332,12570-13662",
                "NodeGroupMembers": [
                    {
                        "CacheClusterId": "mycluster-0002-001",
                        "CacheNodeId": "0001",
                        "PreferredAvailabilityZone": "us-west-2c"
                    },
                    {
                        "CacheClusterId": "mycluster-0002-002",
                        "CacheNodeId": "0001",
                        "PreferredAvailabilityZone": "us-west-2a"
                    },
                    {
                        "CacheClusterId": "mycluster-0002-003",
                        "CacheNodeId": "0001",
                        "PreferredAvailabilityZone": "us-west-2b"
                    }
                ]
            },
            {
                "NodeGroupId": "0003",
                "Status": "modifying",
                "Slots": "0-324,5462-5692,6784-6826,7698-8191,10923-11075,12441-12569,13663-16383",
                "NodeGroupMembers": [
                    {
                        "CacheClusterId": "mycluster-0003-001",
                        "CacheNodeId": "0001",
                        "PreferredAvailabilityZone": "us-west-2c"
                    },
                    {
                        "CacheClusterId": "mycluster-0003-002",
                        "CacheNodeId": "0001",
                        "PreferredAvailabilityZone": "us-west-2b"
                    },
                    {
                        "CacheClusterId": "mycluster-0003-003",
                        "CacheNodeId": "0001",
                        "PreferredAvailabilityZone": "us-west-2a"
                    },
                    {
                        "CacheClusterId": "mycluster-0003-004",
                        "CacheNodeId": "0001",
                        "PreferredAvailabilityZone": "us-west-2c"
                    }
                ]
            },
            {
                "NodeGroupId": "0004",
                "Status": "modifying",
                "Slots": "325-336,4706-5148,7333-7697,9012-10922,11076-12440",
                "NodeGroupMembers": [
                    {
                        "CacheClusterId": "mycluster-0004-001",
                        "CacheNodeId": "0001",
                        "PreferredAvailabilityZone": "us-west-2b"
                    },
                    {
                        "CacheClusterId": "mycluster-0004-002",
                        "CacheNodeId": "0001",
                        "PreferredAvailabilityZone": "us-west-2a"
                    },
                    {
                        "CacheClusterId": "mycluster-0004-003",
                        "CacheNodeId": "0001",
                        "PreferredAvailabilityZone": "us-west-2c"
                    }
                ]
            },
            {
                "NodeGroupId": "0005",
                "Status": "modifying",
                "Slots": "337-893,1768-3133,4444-4705,5693-6783,8192-9011",
                "NodeGroupMembers": [
                    {
                        "CacheClusterId": "mycluster-0005-001",
                        "CacheNodeId": "0001",
                        "PreferredAvailabilityZone": "us-west-2a"
                    },
                    {
                        "CacheClusterId": "mycluster-0005-002",
                        "CacheNodeId": "0001",
                        "PreferredAvailabilityZone": "us-west-2c"
                    },
                    {
                        "CacheClusterId": "mycluster-0005-003",
                        "CacheNodeId": "0001",
                        "PreferredAvailabilityZone": "us-west-2b"
                    }
                ]
            }
        ],
        "AutomaticFailover": "enabled",
        "MultiAZ": "enabled",
        "ConfigurationEndpoint": {
            "Address": "mycluster.g2xbih.clustercfg.usw2.cache.amazonaws.com",
            "Port": 6379
        },
        "SnapshotRetentionLimit": 1,
        "SnapshotWindow": "13:00-14:00",
        "ClusterEnabled": true,
        "CacheNodeType": "cache.r5.xlarge",
        "TransitEncryptionEnabled": false,
        "AtRestEncryptionEnabled": false
    }
}

For more information, see Scaling ElastiCache for Redis Clusters in the Elasticache User Guide.

Output

ReplicationGroup -> (structure)

Contains all of the attributes of a specific Valkey or Redis OSS replication group.

ReplicationGroupId -> (string)

The identifier for the replication group.

Description -> (string)

The user supplied description of the replication group.

GlobalReplicationGroupInfo -> (structure)

The name of the Global datastore and role of this replication group in the Global datastore.

GlobalReplicationGroupId -> (string)

The name of the Global datastore

GlobalReplicationGroupMemberRole -> (string)

The role of the replication group in a Global datastore. Can be primary or secondary.

Status -> (string)

The current state of this replication group - creating , available , modifying , deleting , create-failed , snapshotting .

PendingModifiedValues -> (structure)

A group of settings to be applied to the replication group, either immediately or during the next maintenance window.

PrimaryClusterId -> (string)

The primary cluster ID that is applied immediately (if --apply-immediately was specified), or during the next maintenance window.

AutomaticFailoverStatus -> (string)

Indicates the status of automatic failover for this Valkey or Redis OSS replication group.

Resharding -> (structure)

The status of an online resharding operation.

SlotMigration -> (structure)

Represents the progress of an online resharding operation.

ProgressPercentage -> (double)

The percentage of the slot migration that is complete.

AuthTokenStatus -> (string)

The auth token status

UserGroups -> (structure)

The user group being modified.

UserGroupIdsToAdd -> (list)

The ID of the user group to add.

(string)

UserGroupIdsToRemove -> (list)

The ID of the user group to remove.

(string)

LogDeliveryConfigurations -> (list)

The log delivery configurations being modified

(structure)

The log delivery configurations being modified

LogType -> (string)

Refers to slow-log or engine-log..

DestinationType -> (string)

Returns the destination type, either CloudWatch Logs or Kinesis Data Firehose.

DestinationDetails -> (structure)

Configuration details of either a CloudWatch Logs destination or Kinesis Data Firehose destination.

CloudWatchLogsDetails -> (structure)

The configuration details of the CloudWatch Logs destination.

LogGroup -> (string)

The name of the CloudWatch Logs log group.

KinesisFirehoseDetails -> (structure)

The configuration details of the Kinesis Data Firehose destination.

DeliveryStream -> (string)

The name of the Kinesis Data Firehose delivery stream.

LogFormat -> (string)

Returns the log format, either JSON or TEXT

TransitEncryptionEnabled -> (boolean)

A flag that enables in-transit encryption when set to true.

TransitEncryptionMode -> (string)

A setting that allows you to migrate your clients to use in-transit encryption, with no downtime.

ClusterMode -> (string)

Enabled or Disabled. 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.

MemberClusters -> (list)

The names of all the cache clusters that are part of this replication group.

(string)

NodeGroups -> (list)

A list of node groups in this replication group. For Valkey or Redis OSS (cluster mode disabled) replication groups, this is a single-element list. For Valkey or Redis OSS (cluster mode enabled) replication groups, the list contains an entry for each node group (shard).

(structure)

Represents a collection of cache nodes in a replication group. One node in the node group is the read/write primary node. All the other nodes are read-only Replica nodes.

NodeGroupId -> (string)

The identifier for the node group (shard). A Valkey or Redis OSS (cluster mode disabled) replication group contains only 1 node group; therefore, the node group ID is 0001. A Valkey or Redis OSS (cluster mode enabled) replication group contains 1 to 90 node groups numbered 0001 to 0090. Optionally, the user can provide the id for a node group.

Status -> (string)

The current state of this replication group - creating , available , modifying , deleting .

PrimaryEndpoint -> (structure)

The endpoint of the primary node in this node group (shard).

Address -> (string)

The DNS hostname of the cache node.

Port -> (integer)

The port number that the cache engine is listening on.

ReaderEndpoint -> (structure)

The endpoint of the replica nodes in this node group (shard). This value is read-only.

Address -> (string)

The DNS hostname of the cache node.

Port -> (integer)

The port number that the cache engine is listening on.

Slots -> (string)

The keyspace for this node group (shard).

NodeGroupMembers -> (list)

A list containing information about individual nodes within the node group (shard).

(structure)

Represents a single node within a node group (shard).

CacheClusterId -> (string)

The ID of the cluster to which the node belongs.

CacheNodeId -> (string)

The ID of the node within its cluster. A node ID is a numeric identifier (0001, 0002, etc.).

ReadEndpoint -> (structure)

The information required for client programs to connect to a node for read operations. The read endpoint is only applicable on Valkey or Redis OSS (cluster mode disabled) clusters.

Address -> (string)

The DNS hostname of the cache node.

Port -> (integer)

The port number that the cache engine is listening on.

PreferredAvailabilityZone -> (string)

The name of the Availability Zone in which the node is located.

PreferredOutpostArn -> (string)

The outpost ARN of the node group member.

CurrentRole -> (string)

The role that is currently assigned to the node - primary or replica . This member is only applicable for Valkey or Redis OSS (cluster mode disabled) replication groups.

SnapshottingClusterId -> (string)

The cluster ID that is used as the daily snapshot source for the replication group.

AutomaticFailover -> (string)

Indicates the status of automatic failover for this Valkey or Redis OSS replication group.

MultiAZ -> (string)

A flag indicating if you have Multi-AZ enabled to enhance fault tolerance. For more information, see Minimizing Downtime: Multi-AZ

ConfigurationEndpoint -> (structure)

The configuration endpoint for this replication group. Use the configuration endpoint to connect to this replication group.

Address -> (string)

The DNS hostname of the cache node.

Port -> (integer)

The port number that the cache engine is listening on.

SnapshotRetentionLimit -> (integer)

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.

Warning

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

SnapshotWindow -> (string)

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

Example: 05:00-09:00

If you do not specify this parameter, ElastiCache automatically chooses an appropriate time range.

Note

This parameter is only valid if the Engine parameter is redis .

ClusterEnabled -> (boolean)

A flag indicating whether or not this replication group is cluster enabled; i.e., whether its data can be partitioned across multiple shards (API/CLI: node groups).

Valid values: true | false

CacheNodeType -> (string)

The name of the compute and memory capacity node type for each node in the replication group.

AuthTokenEnabled -> (boolean)

A flag that enables using an AuthToken (password) when issuing Valkey or Redis OSS commands.

Default: false

AuthTokenLastModifiedDate -> (timestamp)

The date the auth token was last modified

TransitEncryptionEnabled -> (boolean)

A flag that enables in-transit encryption when set to true .

Required: Only available when creating a replication group in an Amazon VPC using Redis OSS version 3.2.6 , 4.x or later.

Default: false

AtRestEncryptionEnabled -> (boolean)

A flag that enables encryption at-rest when set to true .

You cannot modify the value of AtRestEncryptionEnabled after the cluster is created. To enable encryption at-rest on a cluster you must set AtRestEncryptionEnabled to true when you create a cluster.

Required: Only available when creating a replication group in an Amazon VPC using Redis OSS version 3.2.6 , 4.x or later.

Default: false

MemberClustersOutpostArns -> (list)

The outpost ARNs of the replication group's member clusters.

(string)

KmsKeyId -> (string)

The ID of the KMS key used to encrypt the disk in the cluster.

ARN -> (string)

The ARN (Amazon Resource Name) of the replication group.

UserGroupIds -> (list)

The ID of the user group associated to the replication group.

(string)

LogDeliveryConfigurations -> (list)

Returns the destination, format and type of the logs.

(structure)

Returns the destination, format and type of the logs.

LogType -> (string)

Refers to slow-log or engine-log.

DestinationType -> (string)

Returns the destination type, either cloudwatch-logs or kinesis-firehose .

DestinationDetails -> (structure)

Configuration details of either a CloudWatch Logs destination or Kinesis Data Firehose destination.

CloudWatchLogsDetails -> (structure)

The configuration details of the CloudWatch Logs destination.

LogGroup -> (string)

The name of the CloudWatch Logs log group.

KinesisFirehoseDetails -> (structure)

The configuration details of the Kinesis Data Firehose destination.

DeliveryStream -> (string)

The name of the Kinesis Data Firehose delivery stream.

LogFormat -> (string)

Returns the log format, either JSON or TEXT.

Status -> (string)

Returns the log delivery configuration status. Values are one of enabling | disabling | modifying | active | error

Message -> (string)

Returns an error message for the log delivery configuration.

ReplicationGroupCreateTime -> (timestamp)

The date and time when the cluster was created.

DataTiering -> (string)

Enables data tiering. Data tiering is only supported for replication groups using the r6gd node type. This parameter must be set to true when using r6gd nodes. For more information, see Data tiering .

AutoMinorVersionUpgrade -> (boolean)

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

NetworkType -> (string)

Must be either ipv4 | ipv6 | dual_stack . IPv6 is supported for workloads using Valkey 7.2 and above, Redis OSS engine version 6.2 and above or Memcached engine version 1.6.6 and above on all instances built on the Nitro system .

IpDiscovery -> (string)

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 and above or Memcached engine version 1.6.6 and above on all instances built on the Nitro system .

TransitEncryptionMode -> (string)

A setting that allows you to migrate your clients to use in-transit encryption, with no downtime.

ClusterMode -> (string)

Enabled or Disabled. 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 -> (string)

The engine used in a replication group. The options are redis, memcached or valkey.