Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removes plan-time validation for automatic_failover_enabled #18635

Merged
merged 2 commits into from
Apr 8, 2021

Conversation

gdavison
Copy link
Contributor

@gdavison gdavison commented Apr 7, 2021

The plan-time validation also depends on whether the parameter group used enables Redis cluster mode, that is, setting the parameter cluster-enabled to yes. If so, automatic_failover_enabled must be true, otherwise, the replication group must have at least two clusters.

By disabling plan-time validation, we allow the AWS API to perform the correct validation.

Closes #18522

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccAWSElasticacheReplicationGroup_'

--- PASS: TestAccAWSElasticacheReplicationGroup_Validation_NoNodeType (69.27s)
--- PASS: TestAccAWSElasticacheReplicationGroup_basic (875.31s)
--- PASS: TestAccAWSElasticacheReplicationGroup_clusteringAndCacheNodesCausesError (7.18s)
--- PASS: TestAccAWSElasticacheReplicationGroup_enableSnapshotting (936.69s)
--- PASS: TestAccAWSElasticacheReplicationGroup_Validation_GlobalReplicationGroupIdAndNodeType (957.94s)
--- PASS: TestAccAWSElasticacheReplicationGroup_tags (994.14s)
--- PASS: TestAccAWSElasticacheReplicationGroup_useCmkKmsKeyId (1147.09s)
--- PASS: TestAccAWSElasticacheReplicationGroup_enableAuthTokenTransitEncryption (1148.37s)
--- PASS: TestAccAWSElasticacheReplicationGroup_enableAtRestEncryption (1209.74s)
--- PASS: TestAccAWSElasticacheReplicationGroup_NumberCacheClusters_MemberClusterDisappears_RemoveMemberCluster_AtTargetSize (1369.61s)
--- PASS: TestAccAWSElasticacheReplicationGroup_NumberCacheClusters_MemberClusterDisappears_RemoveMemberCluster_ScaleDown (1400.00s)
--- PASS: TestAccAWSElasticacheReplicationGroup_NumberCacheClusters_MultiAZEnabled (1607.28s)
--- PASS: TestAccAWSElasticacheReplicationGroup_FinalSnapshot (1707.20s)
--- PASS: TestAccAWSElasticacheReplicationGroup_Validation_multiAz_NoAutomaticFailover (9.34s)
--- PASS: TestAccAWSElasticacheReplicationGroup_NumberCacheClusters_Failover_AutoFailoverDisabled (1829.12s)
--- PASS: TestAccAWSElasticacheReplicationGroup_NumberCacheClusters_MemberClusterDisappears_NoChange (2134.73s)
--- PASS: TestAccAWSElasticacheReplicationGroup_NumberCacheClusters_Basic (2179.75s)
--- PASS: TestAccAWSElasticacheReplicationGroup_ClusterMode_SingleNode (1350.87s)
--- PASS: TestAccAWSElasticacheReplicationGroup_ClusterMode_NonClusteredParameterGroup (1121.13s)
--- FAIL: TestAccAWSElasticacheReplicationGroup_GlobalReplicationGroupId_Full (2348.58s)
--- PASS: TestAccAWSElasticacheReplicationGroup_NumberCacheClusters_MemberClusterDisappears_AddMemberCluster (2413.39s)
--- PASS: TestAccAWSElasticacheReplicationGroup_ClusterMode_Basic (1100.41s)
--- PASS: TestAccAWSElasticacheReplicationGroup_ClusterMode_UpdateReplicasPerNodeGroup (1686.20s)
--- PASS: TestAccAWSElasticacheReplicationGroup_multiAzInVpc (915.66s)
--- PASS: TestAccAWSElasticacheReplicationGroup_GlobalReplicationGroupId_disappears (2756.72s)
--- PASS: TestAccAWSElasticacheReplicationGroup_updateDescription (1182.39s)
--- PASS: TestAccAWSElasticacheReplicationGroup_updateParameterGroup (1390.26s)
--- PASS: TestAccAWSElasticacheReplicationGroup_NumberCacheClusters_Failover_AutoFailoverEnabled (2919.97s)
--- PASS: TestAccAWSElasticacheReplicationGroup_vpc (876.68s)
--- PASS: TestAccAWSElasticacheReplicationGroup_updateMaintenanceWindow (1095.95s)
--- FAIL: TestAccAWSElasticacheReplicationGroup_GlobalReplicationGroupId_Basic (3239.27s)
--- PASS: TestAccAWSElasticacheReplicationGroup_Uppercase (1005.35s)
--- PASS: TestAccAWSElasticacheReplicationGroup_disappears (1229.63s)
--- PASS: TestAccAWSElasticacheReplicationGroup_redisClusterInVpc2 (3532.91s)
--- PASS: TestAccAWSElasticacheReplicationGroup_ClusterMode_UpdateNumNodeGroupsAndReplicasPerNodeGroup_ScaleUp (2658.64s)
--- PASS: TestAccAWSElasticacheReplicationGroup_ClusterMode_UpdateNumNodeGroupsAndReplicasPerNodeGroup_ScaleDown (2788.05s)
--- PASS: TestAccAWSElasticacheReplicationGroup_updateNodeSize (2354.06s)
--- PASS: TestAccAWSElasticacheReplicationGroup_ClusterMode_UpdateNumNodeGroups_ScaleUp (3088.55s)
--- PASS: TestAccAWSElasticacheReplicationGroup_multiAzNotInVpc (2000.41s)
--- PASS: TestAccAWSElasticacheReplicationGroup_ClusterMode_UpdateNumNodeGroups_ScaleDown (3590.34s)

The test failures TestAccAWSElasticacheReplicationGroup_GlobalReplicationGroupId_Full and TestAccAWSElasticacheReplicationGroup_GlobalReplicationGroupId_Basic are related to #18625

The plan-time validation also depends on whether the parameter group used enabled Redis cluster mode. If so, `automatic_failover_enabled` must be true, otherwise, the replication group must have at least two clusters
@gdavison gdavison requested a review from a team as a code owner April 7, 2021 20:30
@ghost ghost added size/M Managed by automation to categorize the size of a PR. service/elasticache Issues and PRs that pertain to the elasticache service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Apr 7, 2021
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 🚀

@bflad bflad merged commit aef94ab into main Apr 8, 2021
@bflad bflad deleted the elasticache-clustermode-failover branch April 8, 2021 23:23
@github-actions github-actions bot added this to the v3.36.0 milestone Apr 8, 2021
github-actions bot pushed a commit that referenced this pull request Apr 8, 2021
@ghost
Copy link

ghost commented Apr 9, 2021

This has been released in version 3.36.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@ghost
Copy link

ghost commented May 9, 2021

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators May 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/elasticache Issues and PRs that pertain to the elasticache service. size/M Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

aws_elasticache_replication_group logic does not permit automatic_failover_enabled when num_of_clusters = 1
2 participants