hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.83k stars 9.17k forks source link

[Bug]: resource/aws_elasticache_replication_group: Prevents `automatic_failover_enabled` being off in cluster_mode #39271

Open aolley opened 1 month ago

aolley commented 1 month ago

Terraform Core Version

1.5.7

AWS Provider Version

5.66.0

Affected Resource(s)

Expected Behavior

Setting a replication group with:

Should be possible.

Actual Behavior

Terraform validation prevents it.

Relevant Error/Panic Output Snippet

Planning failed. Terraform encountered an error while generating this plan.

╷
│ Error: "num_cache_clusters": must be at least 2 if automatic_failover_enabled is true

Terraform Configuration Files

No specific config needed.

Steps to Reproduce

Try to plan a replication group with:

Debug Output

No response

Panic Output

No response

Important Factoids

This was a problem in the past, it was fixed in this PR for 3.36: https://github.com/hashicorp/terraform-provider-aws/pull/18635

The same issue was (mistakenly?) re-introduced in 5.59: https://github.com/hashicorp/terraform-provider-aws/pull/38396

Note, AWS API returns the following if you try to turn off automatic failover:

InvalidParameterCombination: Turning off automatic failover for replication group with cluster mode enabled is not supported.

References

No response

Would you like to implement a fix?

None

github-actions[bot] commented 1 month ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue

aolley commented 1 month ago

@gdavison pinging you since you likely have the most context here given your involvement in the previous PRs. Are we able to fine tune the validation to handle when cluster_mode is enabled?