From f893c221f533205c3f59588686858dec3a5316b8 Mon Sep 17 00:00:00 2001 From: nikhil Date: Sun, 16 Jun 2024 17:35:53 +0100 Subject: [PATCH 1/8] aws_elasticache_replication_group --- .../service/elasticache/replication_group.go | 16 ++++ .../elasticache/replication_group_test.go | 76 +++++++++++++++++++ 2 files changed, 92 insertions(+) diff --git a/internal/service/elasticache/replication_group.go b/internal/service/elasticache/replication_group.go index 9920ba80e82..8de672a108a 100644 --- a/internal/service/elasticache/replication_group.go +++ b/internal/service/elasticache/replication_group.go @@ -92,6 +92,12 @@ func resourceReplicationGroup() *schema.Resource { Type: schema.TypeBool, Computed: true, }, + "cluster_mode": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ValidateFunc: validation.StringInSlice(elasticache.ClusterMode_Values(), true), + }, "configuration_endpoint_address": { Type: schema.TypeString, Computed: true, @@ -420,6 +426,10 @@ func resourceReplicationGroupCreate(ctx context.Context, d *schema.ResourceData, } } + if v, ok := d.GetOk("cluster_mode"); ok { + input.ClusterMode = aws.String(v.(string)) + } + if v, ok := d.GetOk("data_tiering_enabled"); ok { input.DataTieringEnabled = aws.Bool(v.(bool)) } @@ -653,6 +663,7 @@ func resourceReplicationGroupRead(ctx context.Context, d *schema.ResourceData, m d.Set("replicas_per_node_group", len(rgp.NodeGroups[0].NodeGroupMembers)-1) d.Set("cluster_enabled", rgp.ClusterEnabled) + d.Set("cluster_mode", rgp.ClusterMode) d.Set("replication_group_id", rgp.ReplicationGroupId) d.Set(names.AttrARN, rgp.ARN) d.Set("data_tiering_enabled", aws.StringValue(rgp.DataTiering) == elasticache.DataTieringStatusEnabled) @@ -775,6 +786,11 @@ func resourceReplicationGroupUpdate(ctx context.Context, d *schema.ResourceData, requestUpdate = true } + if d.HasChange("cluster_mode") { + input.ClusterMode = aws.String(d.Get("cluster_mode").(string)) + requestUpdate = true + } + if d.HasChange(names.AttrEngineVersion) { input.EngineVersion = aws.String(d.Get(names.AttrEngineVersion).(string)) requestUpdate = true diff --git a/internal/service/elasticache/replication_group_test.go b/internal/service/elasticache/replication_group_test.go index 936b93e1662..5e8fb9e83d4 100644 --- a/internal/service/elasticache/replication_group_test.go +++ b/internal/service/elasticache/replication_group_test.go @@ -1313,6 +1313,62 @@ func TestAccElastiCacheReplicationGroup_ClusterMode_singleNode(t *testing.T) { }) } +func TestAccElastiCacheReplicationGroup_ClusterMode_updateFromDisabled_Compatible_Enabled(t *testing.T) { + ctx := acctest.Context(t) + if testing.Short() { + t.Skip("skipping long-running test in short mode") + } + + var rg elasticache.ReplicationGroup + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_elasticache_replication_group.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.ElastiCacheServiceID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckReplicationGroupDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccElastiCacheReplicationGroup_ClusterMode_updateFromDisabled_Compatible_Enabled(rName, "disabled"), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckReplicationGroupExists(ctx, resourceName, &rg), + resource.TestCheckResourceAttr(resourceName, "cluster_enabled", acctest.CtFalse), + resource.TestCheckResourceAttr(resourceName, "cluster_mode", "disabled"), + resource.TestCheckResourceAttr(resourceName, "num_node_groups", acctest.Ct1), + resource.TestCheckResourceAttr(resourceName, "replicas_per_node_group", acctest.Ct1), + resource.TestCheckResourceAttr(resourceName, "num_cache_clusters", acctest.Ct2), + resource.TestCheckResourceAttr(resourceName, "member_clusters.#", acctest.Ct2), + ), + }, + { + Config: testAccElastiCacheReplicationGroup_ClusterMode_updateFromDisabled_Compatible_Enabled(rName, "compatible"), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckReplicationGroupExists(ctx, resourceName, &rg), + resource.TestCheckResourceAttr(resourceName, "cluster_enabled", acctest.CtFalse), + resource.TestCheckResourceAttr(resourceName, "cluster_mode", "compatible"), + resource.TestCheckResourceAttr(resourceName, "num_node_groups", acctest.Ct1), + resource.TestCheckResourceAttr(resourceName, "replicas_per_node_group", acctest.Ct1), + resource.TestCheckResourceAttr(resourceName, "num_cache_clusters", acctest.Ct2), + resource.TestCheckResourceAttr(resourceName, "member_clusters.#", acctest.Ct2), + ), + }, + { + Config: testAccElastiCacheReplicationGroup_ClusterMode_updateFromDisabled_Compatible_Enabled(rName, "enabled"), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckReplicationGroupExists(ctx, resourceName, &rg), + resource.TestCheckResourceAttr(resourceName, "cluster_enabled", acctest.CtTrue), + resource.TestCheckResourceAttr(resourceName, "cluster_mode", "enabled"), + resource.TestCheckResourceAttr(resourceName, "num_node_groups", acctest.Ct2), + resource.TestCheckResourceAttr(resourceName, "replicas_per_node_group", acctest.Ct2), + resource.TestCheckResourceAttr(resourceName, "num_cache_clusters", "6"), + resource.TestCheckResourceAttr(resourceName, "member_clusters.#", "6"), + ), + }, + }, + }) +} + func TestAccElastiCacheReplicationGroup_clusteringAndCacheNodesCausesError(t *testing.T) { ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -3551,6 +3607,26 @@ resource "aws_elasticache_replication_group" "test" { ) } +func testAccElastiCacheReplicationGroup_ClusterMode_updateFromDisabled_Compatible_Enabled(rName, clusterMode string) string { + return acctest.ConfigCompose( + acctest.ConfigAvailableAZsNoOptIn(), + fmt.Sprintf(` +resource "aws_elasticache_replication_group" "test" { + replication_group_id = %[1]q + description = "test description" + node_type = "cache.t2.medium" + apply_immediately = true + automatic_failover_enabled = true + cluster_mode = %[2]q + engine_version = "7.1" + parameter_group_name = "default.redis7" + num_node_groups = 1 + replicas_per_node_group = 1 +} +`, rName, clusterMode), + ) +} + func testAccReplicationGroupConfig_useCMKKMSKeyID(rName string) string { return acctest.ConfigCompose( acctest.ConfigVPCWithSubnets(rName, 1), From 92239363e8269e590be93bd8a06c1cc7d66d2602 Mon Sep 17 00:00:00 2001 From: nikhil Date: Sun, 16 Jun 2024 17:42:55 +0100 Subject: [PATCH 2/8] aws_elasticache_replication_group --- .changelog/38002.txt | 3 +++ website/docs/r/elasticache_replication_group.html.markdown | 1 + 2 files changed, 4 insertions(+) create mode 100644 .changelog/38002.txt diff --git a/.changelog/38002.txt b/.changelog/38002.txt new file mode 100644 index 00000000000..7a8ce7b7243 --- /dev/null +++ b/.changelog/38002.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/aws_elasticache_replication_group: Add `cluster_mode` argument +``` \ No newline at end of file diff --git a/website/docs/r/elasticache_replication_group.html.markdown b/website/docs/r/elasticache_replication_group.html.markdown index 0f2ed4d3c8d..9f7f4a538be 100644 --- a/website/docs/r/elasticache_replication_group.html.markdown +++ b/website/docs/r/elasticache_replication_group.html.markdown @@ -201,6 +201,7 @@ The following arguments are optional: Only supported for engine type `"redis"` and if the engine version is 6 or higher. Defaults to `true`. * `automatic_failover_enabled` - (Optional) Specifies whether a read-only replica will be automatically promoted to read/write primary if the existing primary fails. If enabled, `num_cache_clusters` must be greater than 1. Must be enabled for Redis (cluster mode enabled) replication groups. Defaults to `false`. +* `cluster_mode` - (Optional) Specifies whether cluster mode is enabled or disabled. Valid values are `enabled` or `disabled` or `compatible` * `data_tiering_enabled` - (Optional) 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. * `engine` - (Optional) Name of the cache engine to be used for the clusters in this replication group. The only valid value is `redis`. * `engine_version` - (Optional) Version number of the cache engine to be used for the cache clusters in this replication group. From b1d251165a51da37c12f3bcd8107b9e537059030 Mon Sep 17 00:00:00 2001 From: nikhil Date: Sun, 16 Jun 2024 18:07:31 +0100 Subject: [PATCH 3/8] aws_elasticache_replication_group --- internal/service/elasticache/replication_group_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/service/elasticache/replication_group_test.go b/internal/service/elasticache/replication_group_test.go index 5e8fb9e83d4..10da7b17982 100644 --- a/internal/service/elasticache/replication_group_test.go +++ b/internal/service/elasticache/replication_group_test.go @@ -1330,7 +1330,7 @@ func TestAccElastiCacheReplicationGroup_ClusterMode_updateFromDisabled_Compatibl CheckDestroy: testAccCheckReplicationGroupDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccElastiCacheReplicationGroup_ClusterMode_updateFromDisabled_Compatible_Enabled(rName, "disabled"), + Config: testAccReplicationGroup_ClusterMode_updateFromDisabled_Compatible_Enabled(rName, "disabled"), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckReplicationGroupExists(ctx, resourceName, &rg), resource.TestCheckResourceAttr(resourceName, "cluster_enabled", acctest.CtFalse), @@ -1342,7 +1342,7 @@ func TestAccElastiCacheReplicationGroup_ClusterMode_updateFromDisabled_Compatibl ), }, { - Config: testAccElastiCacheReplicationGroup_ClusterMode_updateFromDisabled_Compatible_Enabled(rName, "compatible"), + Config: testAccReplicationGroup_ClusterMode_updateFromDisabled_Compatible_Enabled(rName, "compatible"), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckReplicationGroupExists(ctx, resourceName, &rg), resource.TestCheckResourceAttr(resourceName, "cluster_enabled", acctest.CtFalse), @@ -1354,11 +1354,11 @@ func TestAccElastiCacheReplicationGroup_ClusterMode_updateFromDisabled_Compatibl ), }, { - Config: testAccElastiCacheReplicationGroup_ClusterMode_updateFromDisabled_Compatible_Enabled(rName, "enabled"), + Config: testAccReplicationGroup_ClusterMode_updateFromDisabled_Compatible_Enabled(rName, names.AttrEnabled), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckReplicationGroupExists(ctx, resourceName, &rg), resource.TestCheckResourceAttr(resourceName, "cluster_enabled", acctest.CtTrue), - resource.TestCheckResourceAttr(resourceName, "cluster_mode", "enabled"), + resource.TestCheckResourceAttr(resourceName, "cluster_mode", names.AttrEnabled), resource.TestCheckResourceAttr(resourceName, "num_node_groups", acctest.Ct2), resource.TestCheckResourceAttr(resourceName, "replicas_per_node_group", acctest.Ct2), resource.TestCheckResourceAttr(resourceName, "num_cache_clusters", "6"), @@ -3607,7 +3607,7 @@ resource "aws_elasticache_replication_group" "test" { ) } -func testAccElastiCacheReplicationGroup_ClusterMode_updateFromDisabled_Compatible_Enabled(rName, clusterMode string) string { +func testAccReplicationGroup_ClusterMode_updateFromDisabled_Compatible_Enabled(rName, clusterMode string) string { return acctest.ConfigCompose( acctest.ConfigAvailableAZsNoOptIn(), fmt.Sprintf(` From 5ca103d2f32c6a97d0b65bbeedad2e8f9f7f8834 Mon Sep 17 00:00:00 2001 From: nikhil Date: Sun, 16 Jun 2024 20:59:08 +0100 Subject: [PATCH 4/8] aws_elasticache_replication_group --- internal/service/elasticache/replication_group_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/service/elasticache/replication_group_test.go b/internal/service/elasticache/replication_group_test.go index 10da7b17982..454debe4849 100644 --- a/internal/service/elasticache/replication_group_test.go +++ b/internal/service/elasticache/replication_group_test.go @@ -1345,7 +1345,7 @@ func TestAccElastiCacheReplicationGroup_ClusterMode_updateFromDisabled_Compatibl Config: testAccReplicationGroup_ClusterMode_updateFromDisabled_Compatible_Enabled(rName, "compatible"), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckReplicationGroupExists(ctx, resourceName, &rg), - resource.TestCheckResourceAttr(resourceName, "cluster_enabled", acctest.CtFalse), + resource.TestCheckResourceAttr(resourceName, "cluster_enabled", acctest.CtTrue), resource.TestCheckResourceAttr(resourceName, "cluster_mode", "compatible"), resource.TestCheckResourceAttr(resourceName, "num_node_groups", acctest.Ct1), resource.TestCheckResourceAttr(resourceName, "replicas_per_node_group", acctest.Ct1), @@ -3622,6 +3622,9 @@ resource "aws_elasticache_replication_group" "test" { parameter_group_name = "default.redis7" num_node_groups = 1 replicas_per_node_group = 1 + timeouts { + create = "60m" + } } `, rName, clusterMode), ) From 7995c002d86259dcb225f19dac7f5ceae5d0198e Mon Sep 17 00:00:00 2001 From: nikhil Date: Sun, 16 Jun 2024 21:00:23 +0100 Subject: [PATCH 5/8] aws_elasticache_replication_group --- internal/service/elasticache/replication_group_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/service/elasticache/replication_group_test.go b/internal/service/elasticache/replication_group_test.go index 454debe4849..b3906037181 100644 --- a/internal/service/elasticache/replication_group_test.go +++ b/internal/service/elasticache/replication_group_test.go @@ -3624,6 +3624,7 @@ resource "aws_elasticache_replication_group" "test" { replicas_per_node_group = 1 timeouts { create = "60m" + update = "60m" } } `, rName, clusterMode), From bf69656ba5acb2362e958b121daac18145639e0f Mon Sep 17 00:00:00 2001 From: nikhil Date: Mon, 17 Jun 2024 18:04:49 +0100 Subject: [PATCH 6/8] aws_elasticache_replication_group --- .../elasticache/replication_group_test.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/internal/service/elasticache/replication_group_test.go b/internal/service/elasticache/replication_group_test.go index b3906037181..318a89b9a4c 100644 --- a/internal/service/elasticache/replication_group_test.go +++ b/internal/service/elasticache/replication_group_test.go @@ -1330,7 +1330,7 @@ func TestAccElastiCacheReplicationGroup_ClusterMode_updateFromDisabled_Compatibl CheckDestroy: testAccCheckReplicationGroupDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccReplicationGroup_ClusterMode_updateFromDisabled_Compatible_Enabled(rName, "disabled"), + Config: testAccReplicationGroup_ClusterMode_updateFromDisabled_Compatible_Enabled(rName, "disabled", false), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckReplicationGroupExists(ctx, resourceName, &rg), resource.TestCheckResourceAttr(resourceName, "cluster_enabled", acctest.CtFalse), @@ -1342,7 +1342,7 @@ func TestAccElastiCacheReplicationGroup_ClusterMode_updateFromDisabled_Compatibl ), }, { - Config: testAccReplicationGroup_ClusterMode_updateFromDisabled_Compatible_Enabled(rName, "compatible"), + Config: testAccReplicationGroup_ClusterMode_updateFromDisabled_Compatible_Enabled(rName, "compatible", true), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckReplicationGroupExists(ctx, resourceName, &rg), resource.TestCheckResourceAttr(resourceName, "cluster_enabled", acctest.CtTrue), @@ -1354,15 +1354,15 @@ func TestAccElastiCacheReplicationGroup_ClusterMode_updateFromDisabled_Compatibl ), }, { - Config: testAccReplicationGroup_ClusterMode_updateFromDisabled_Compatible_Enabled(rName, names.AttrEnabled), + Config: testAccReplicationGroup_ClusterMode_updateFromDisabled_Compatible_Enabled(rName, names.AttrEnabled, true), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckReplicationGroupExists(ctx, resourceName, &rg), resource.TestCheckResourceAttr(resourceName, "cluster_enabled", acctest.CtTrue), resource.TestCheckResourceAttr(resourceName, "cluster_mode", names.AttrEnabled), resource.TestCheckResourceAttr(resourceName, "num_node_groups", acctest.Ct2), - resource.TestCheckResourceAttr(resourceName, "replicas_per_node_group", acctest.Ct2), - resource.TestCheckResourceAttr(resourceName, "num_cache_clusters", "6"), - resource.TestCheckResourceAttr(resourceName, "member_clusters.#", "6"), + resource.TestCheckResourceAttr(resourceName, "replicas_per_node_group", acctest.Ct1), + resource.TestCheckResourceAttr(resourceName, "num_cache_clusters", acctest.Ct2), + resource.TestCheckResourceAttr(resourceName, "member_clusters.#", acctest.Ct2), ), }, }, @@ -3607,7 +3607,7 @@ resource "aws_elasticache_replication_group" "test" { ) } -func testAccReplicationGroup_ClusterMode_updateFromDisabled_Compatible_Enabled(rName, clusterMode string) string { +func testAccReplicationGroup_ClusterMode_updateFromDisabled_Compatible_Enabled(rName, clusterMode string, enableClusterMode bool) string { return acctest.ConfigCompose( acctest.ConfigAvailableAZsNoOptIn(), fmt.Sprintf(` @@ -3619,7 +3619,7 @@ resource "aws_elasticache_replication_group" "test" { automatic_failover_enabled = true cluster_mode = %[2]q engine_version = "7.1" - parameter_group_name = "default.redis7" + parameter_group_name = tobool("%[3]t") ? "default.redis7.cluster.on" : "default.redis7" num_node_groups = 1 replicas_per_node_group = 1 timeouts { @@ -3627,7 +3627,7 @@ resource "aws_elasticache_replication_group" "test" { update = "60m" } } -`, rName, clusterMode), +`, rName, clusterMode, enableClusterMode), ) } From 583cb1e6483882b271ab5a69605bdffd22673456 Mon Sep 17 00:00:00 2001 From: nikhil Date: Mon, 17 Jun 2024 18:12:51 +0100 Subject: [PATCH 7/8] aws_elasticache_replication_group --- internal/service/elasticache/replication_group_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/service/elasticache/replication_group_test.go b/internal/service/elasticache/replication_group_test.go index 318a89b9a4c..1e710126458 100644 --- a/internal/service/elasticache/replication_group_test.go +++ b/internal/service/elasticache/replication_group_test.go @@ -1359,7 +1359,7 @@ func TestAccElastiCacheReplicationGroup_ClusterMode_updateFromDisabled_Compatibl testAccCheckReplicationGroupExists(ctx, resourceName, &rg), resource.TestCheckResourceAttr(resourceName, "cluster_enabled", acctest.CtTrue), resource.TestCheckResourceAttr(resourceName, "cluster_mode", names.AttrEnabled), - resource.TestCheckResourceAttr(resourceName, "num_node_groups", acctest.Ct2), + resource.TestCheckResourceAttr(resourceName, "num_node_groups", acctest.Ct1), resource.TestCheckResourceAttr(resourceName, "replicas_per_node_group", acctest.Ct1), resource.TestCheckResourceAttr(resourceName, "num_cache_clusters", acctest.Ct2), resource.TestCheckResourceAttr(resourceName, "member_clusters.#", acctest.Ct2), From f19f9f8ed19328d3ff61983d49783ca361ad1ea7 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 17 Jul 2024 09:08:24 -0400 Subject: [PATCH 8/8] d/aws_elasticache_replication_group: Add `cluster_mode` attribute. --- .changelog/38002.txt | 4 ++++ .../service/elasticache/replication_group_data_source.go | 9 ++++++--- .../elasticache/replication_group_data_source_test.go | 1 + .../docs/d/elasticache_replication_group.html.markdown | 1 + 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.changelog/38002.txt b/.changelog/38002.txt index 7a8ce7b7243..0c0ec580e79 100644 --- a/.changelog/38002.txt +++ b/.changelog/38002.txt @@ -1,3 +1,7 @@ ```release-note:enhancement resource/aws_elasticache_replication_group: Add `cluster_mode` argument +``` + +```release-note:enhancement +data-source/aws_elasticache_replication_group: Add `cluster_mode` attribute ``` \ No newline at end of file diff --git a/internal/service/elasticache/replication_group_data_source.go b/internal/service/elasticache/replication_group_data_source.go index f582054f0f2..895fd6b92e0 100644 --- a/internal/service/elasticache/replication_group_data_source.go +++ b/internal/service/elasticache/replication_group_data_source.go @@ -35,6 +35,10 @@ func dataSourceReplicationGroup() *schema.Resource { Type: schema.TypeBool, Computed: true, }, + "cluster_mode": { + Type: schema.TypeString, + Computed: true, + }, "configuration_endpoint_address": { Type: schema.TypeString, Computed: true, @@ -125,9 +129,7 @@ func dataSourceReplicationGroupRead(ctx context.Context, d *schema.ResourceData, var diags diag.Diagnostics conn := meta.(*conns.AWSClient).ElastiCacheClient(ctx) - groupID := d.Get("replication_group_id").(string) - - rg, err := findReplicationGroupByID(ctx, conn, groupID) + rg, err := findReplicationGroupByID(ctx, conn, d.Get("replication_group_id").(string)) if err != nil { return sdkdiag.AppendFromErr(diags, tfresource.SingularDataSourceFindError("ElastiCache Replication Group", err)) @@ -174,6 +176,7 @@ func dataSourceReplicationGroupRead(ctx context.Context, d *schema.ResourceData, d.Set("node_type", rg.CacheNodeType) d.Set("num_node_groups", len(rg.NodeGroups)) d.Set("replicas_per_node_group", len(rg.NodeGroups[0].NodeGroupMembers)-1) + d.Set("cluster_mode", rg.ClusterMode) d.Set("log_delivery_configuration", flattenLogDeliveryConfigurations(rg.LogDeliveryConfigurations)) d.Set("snapshot_window", rg.SnapshotWindow) d.Set("snapshot_retention_limit", rg.SnapshotRetentionLimit) diff --git a/internal/service/elasticache/replication_group_data_source_test.go b/internal/service/elasticache/replication_group_data_source_test.go index 6a4d98e0243..8ed72bcd723 100644 --- a/internal/service/elasticache/replication_group_data_source_test.go +++ b/internal/service/elasticache/replication_group_data_source_test.go @@ -35,6 +35,7 @@ func TestAccElastiCacheReplicationGroupDataSource_basic(t *testing.T) { resource.TestCheckResourceAttr(dataSourceName, "auth_token_enabled", acctest.CtFalse), resource.TestCheckResourceAttrPair(dataSourceName, names.AttrARN, resourceName, names.AttrARN), resource.TestCheckResourceAttrPair(dataSourceName, "automatic_failover_enabled", resourceName, "automatic_failover_enabled"), + resource.TestCheckResourceAttrPair(dataSourceName, "cluster_mode", resourceName, "cluster_mode"), resource.TestCheckResourceAttrPair(dataSourceName, "multi_az_enabled", resourceName, "multi_az_enabled"), resource.TestCheckResourceAttrPair(dataSourceName, "member_clusters.#", resourceName, "member_clusters.#"), resource.TestCheckResourceAttrPair(dataSourceName, "node_type", resourceName, "node_type"), diff --git a/website/docs/d/elasticache_replication_group.html.markdown b/website/docs/d/elasticache_replication_group.html.markdown index 5675f0e8024..3cb56d5832f 100644 --- a/website/docs/d/elasticache_replication_group.html.markdown +++ b/website/docs/d/elasticache_replication_group.html.markdown @@ -32,6 +32,7 @@ This data source exports the following attributes in addition to the arguments a * `arn` - ARN of the created ElastiCache Replication Group. * `auth_token_enabled` - Whether an AuthToken (password) is enabled. * `automatic_failover_enabled` - A flag whether a read-only replica will be automatically promoted to read/write primary if the existing primary fails. +* `cluster_mode` - Whether cluster mode is enabled or disabled. * `node_type` – The cluster node type. * `num_cache_clusters` – The number of cache clusters that the replication group has. * `num_node_groups` - Number of node groups (shards) for the replication group.