Skip to content

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

@muhammadasgharaliqureshi

Description

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions