When deploying Elasticache clusters or replication group with Terraform, we can't destroy and recreate said cluster or replication set automatically. The PR #15592 introduced the ability to store a final snapshot. But it's impossible to automatically retrieve this final snapshot in a later invocation of the module, because there is no aws_elasticache_snapshot data source.
The idea is to be able to tear down (destroy) a terraform module, containing an Elasticache cluster or replication group, and later bring it back to life in the same state.
Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
Volunteering to Work on This Issue
If you are interested in working on this issue, please leave a comment.
If this would be your first contribution, please review the contribution guide.
Description
When deploying Elasticache clusters or replication group with Terraform, we can't destroy and recreate said cluster or replication set automatically. The PR #15592 introduced the ability to store a final snapshot. But it's impossible to automatically retrieve this final snapshot in a later invocation of the module, because there is no
aws_elasticache_snapshot
data source.This behavior is possible with RDS snapshots, as is proposed in the documentation for
aws_rds_snapshot
resource : https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/db_snapshot#example-usageThe idea is to be able to tear down (destroy) a terraform module, containing an Elasticache cluster or replication group, and later bring it back to life in the same state.
Requested Resource(s) and/or Data Source(s)
aws_elasticache_snapshot
Potential Terraform Configuration
References
15592
14959
Would you like to implement a fix?
Yes