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

[Feature Request] Add snapshot_arns_to_restore support for Serverless ElastiCache Redis #251

Closed
muhammadasgharaliqureshi opened this issue Jan 28, 2025 · 1 comment · Fixed by #252

Comments

@muhammadasgharaliqureshi
Copy link
Contributor

muhammadasgharaliqureshi commented Jan 28, 2025

Describe the Feature

What

Add support for restoring a Serverless Redis cluster from an existing snapshot by exposing the snapshot_arns_to_restore argument in this module.

Why

  • AWS ElastiCache for Redis now offers a serverless deployment option.
  • The Terraform resource aws_elasticache_serverless_cache supports snapshot_arns_to_restore, but the module does not currently provide a way to pass this argument.
  • This feature is crucial for migrating a serverful Redis cluster to a new serverless Redis using a snapshot.

References

Proposed Solution

  1. Introduce a new variable, for example serverless_snapshot_arns_to_restore.
  2. Pass this variable to the aws_elasticache_serverless_cache.default resource in main.tf.
  3. Update the README to document the new variable and provide usage examples.

Example Usage

module "redis_serverless" {
  source = "cloudposse/elasticache-redis/aws"
  serverless_enabled                  = true
  serverless_snapshot_arns_to_restore = ["arn:aws:s3:::my-snapshot-bucket/redis-snapshot.rdb"]
}

Expected Behavior

  • The module should allow users to specify snapshot_arns_to_restore when creating a serverless ElastiCache Redis.
  • A new serverless cluster is successfully restored from the provided snapshot ARN without additional manual steps.

Use Case

We want to migrate an existing (serverful) ElastiCache Redis cluster to serverless by creating a snapshot of the existing cluster and then restoring a new serverless cluster using that snapshot.

Describe Ideal Solution

  • A new variable serverless_snapshot_arns_to_restore is exposed.
  • The value is directly passed to the aws_elasticache_serverless_cache.default resource.
  • The README is updated to illustrate how to use this feature.
  • Terraform plan/apply completes successfully, creating the serverless cluster from the snapshot.

Alternatives Considered

No response

Additional Context

No response

@muhammadasgharaliqureshi
Copy link
Contributor Author

Have created following PR to address this Issue

#252

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant