1
0

feat: elasticache and inplace upgrade from redis to valkey

This commit is contained in:
xpk
2026-03-20 15:45:10 +08:00
parent 61f28b424d
commit 5e8df07654
4 changed files with 155 additions and 0 deletions
+67
View File
@@ -0,0 +1,67 @@
<!-- This readme file is generated with terraform-docs -->
# Elasticache
Deploy a test redis replication group and then in-place migrate to Valkey
## Migration steps (takes around 17m):
1. Backup existing instance. Note the version and parameter group
2. In the example resource below, change apply-immediately, engine, engine-version, and parameter group.
## When redis was initially deployed:
primary\_endpoint = "lab-cache001.rw4ynm.ng.0001.ape1.cache.amazonaws.com"
reader\_endpoint = "lab-cache001-ro.rw4ynm.ng.0001.ape1.cache.amazonaws.com"
## After in-place migration to Valkey:
primary\_endpoint = "lab-cache001.rw4ynm.ng.0001.ape1.cache.amazonaws.com"
reader\_endpoint = "lab-cache001-ro.rw4ynm.ng.0001.ape1.cache.amazonaws.com"
## Fallback
Simply reverting the code below will result in a replacement of the replication group. Meaning
fallback is not supported. One will need to deploy a new instance and restore from backup
## Requirements
| Name | Version |
|------|---------|
| terraform | >= 1.11.0 |
| aws | ~> 6.0 |
## Providers
| Name | Version |
|------|---------|
| aws | 6.37.0 |
## Modules
No modules.
## Resources
| Name | Type |
|------|------|
| [aws_elasticache_replication_group.example](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/elasticache_replication_group) | resource |
| [aws_elasticache_subnet_group.subnets](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/elasticache_subnet_group) | resource |
## Inputs
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| application | n/a | `any` | n/a | yes |
| aws-region | n/a | `any` | n/a | yes |
| customer-name | n/a | `any` | n/a | yes |
| environment | n/a | `any` | n/a | yes |
| owner | n/a | `any` | n/a | yes |
| project | n/a | `any` | n/a | yes |
## Outputs
| Name | Description |
|------|-------------|
| cluster\_endpoint | n/a |
| primary\_endpoint | n/a |
| reader\_endpoint | n/a |
---
## Authorship
This module was developed by xpk.