1**To modify a replication group shard configuration**
2
3The following ``modify-replication-group-shard-configuration`` decreases the node group count using the Redis engine. ::
4
5    aws elasticache modify-replication-group-shard-configuration \
6        --replication-group-id mycluster \
7        --node-group-count 3 \
8        --apply-immediately \
9        --node-groups-to-remove 0002
10
11Output ::
12
13    {
14        "ReplicationGroup": {
15            "ReplicationGroupId": "mycluster",
16            "Description": "mycluster",
17            "GlobalReplicationGroupInfo": {},
18            "Status": "modifying",
19            "PendingModifiedValues": {},
20            "MemberClusters": [
21                "mycluster-0002-001",
22                "mycluster-0002-002",
23                "mycluster-0002-003",
24                "mycluster-0003-001",
25                "mycluster-0003-002",
26                "mycluster-0003-003",
27                "mycluster-0003-004",
28                "mycluster-0004-001",
29                "mycluster-0004-002",
30                "mycluster-0004-003",
31                "mycluster-0005-001",
32                "mycluster-0005-002",
33                "mycluster-0005-003"
34            ],
35            "NodeGroups": [
36                {
37                    "NodeGroupId": "0002",
38                    "Status": "modifying",
39                    "Slots": "894-1767,3134-4443,5149-5461,6827-7332,12570-13662",
40                    "NodeGroupMembers": [
41                        {
42                            "CacheClusterId": "mycluster-0002-001",
43                            "CacheNodeId": "0001",
44                            "PreferredAvailabilityZone": "us-west-2c"
45                        },
46                        {
47                            "CacheClusterId": "mycluster-0002-002",
48                            "CacheNodeId": "0001",
49                            "PreferredAvailabilityZone": "us-west-2a"
50                        },
51                        {
52                            "CacheClusterId": "mycluster-0002-003",
53                            "CacheNodeId": "0001",
54                            "PreferredAvailabilityZone": "us-west-2b"
55                        }
56                    ]
57                },
58                {
59                    "NodeGroupId": "0003",
60                    "Status": "modifying",
61                    "Slots": "0-324,5462-5692,6784-6826,7698-8191,10923-11075,12441-12569,13663-16383",
62                    "NodeGroupMembers": [
63                        {
64                            "CacheClusterId": "mycluster-0003-001",
65                            "CacheNodeId": "0001",
66                            "PreferredAvailabilityZone": "us-west-2c"
67                        },
68                        {
69                            "CacheClusterId": "mycluster-0003-002",
70                            "CacheNodeId": "0001",
71                            "PreferredAvailabilityZone": "us-west-2b"
72                        },
73                        {
74                            "CacheClusterId": "mycluster-0003-003",
75                            "CacheNodeId": "0001",
76                            "PreferredAvailabilityZone": "us-west-2a"
77                        },
78                        {
79                            "CacheClusterId": "mycluster-0003-004",
80                            "CacheNodeId": "0001",
81                            "PreferredAvailabilityZone": "us-west-2c"
82                        }
83                    ]
84                },
85                {
86                    "NodeGroupId": "0004",
87                    "Status": "modifying",
88                    "Slots": "325-336,4706-5148,7333-7697,9012-10922,11076-12440",
89                    "NodeGroupMembers": [
90                        {
91                            "CacheClusterId": "mycluster-0004-001",
92                            "CacheNodeId": "0001",
93                            "PreferredAvailabilityZone": "us-west-2b"
94                        },
95                        {
96                            "CacheClusterId": "mycluster-0004-002",
97                            "CacheNodeId": "0001",
98                            "PreferredAvailabilityZone": "us-west-2a"
99                        },
100                        {
101                            "CacheClusterId": "mycluster-0004-003",
102                            "CacheNodeId": "0001",
103                            "PreferredAvailabilityZone": "us-west-2c"
104                        }
105                    ]
106                },
107                {
108                    "NodeGroupId": "0005",
109                    "Status": "modifying",
110                    "Slots": "337-893,1768-3133,4444-4705,5693-6783,8192-9011",
111                    "NodeGroupMembers": [
112                        {
113                            "CacheClusterId": "mycluster-0005-001",
114                            "CacheNodeId": "0001",
115                            "PreferredAvailabilityZone": "us-west-2a"
116                        },
117                        {
118                            "CacheClusterId": "mycluster-0005-002",
119                            "CacheNodeId": "0001",
120                            "PreferredAvailabilityZone": "us-west-2c"
121                        },
122                        {
123                            "CacheClusterId": "mycluster-0005-003",
124                            "CacheNodeId": "0001",
125                            "PreferredAvailabilityZone": "us-west-2b"
126                        }
127                    ]
128                }
129            ],
130            "AutomaticFailover": "enabled",
131            "MultiAZ": "enabled",
132            "ConfigurationEndpoint": {
133                "Address": "mycluster.g2xbih.clustercfg.usw2.cache.amazonaws.com",
134                "Port": 6379
135            },
136            "SnapshotRetentionLimit": 1,
137            "SnapshotWindow": "13:00-14:00",
138            "ClusterEnabled": true,
139            "CacheNodeType": "cache.r5.xlarge",
140            "TransitEncryptionEnabled": false,
141            "AtRestEncryptionEnabled": false
142        }
143    }
144
145For more information, see `Scaling ElastiCache for Redis Clusters <https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/Scaling.html>`__ in the *Elasticache User Guide*.