Skip to content

Commit b878ddc

Browse files
authored
chore(snapshot): Allow restore from a snapshot (#46)
1 parent 75ddee5 commit b878ddc

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ No modules.
143143
| <a name="input_preferred_cache_cluster_azs"></a> [preferred\_cache\_cluster\_azs](#input\_preferred\_cache\_cluster\_azs) | A list of EC2 availability zones in which the replication group's cache clusters will be created. The order of the availability zones in the list is not important. | `list(string)` | `null` | no |
144144
| <a name="input_replicas_per_node_group"></a> [replicas\_per\_node\_group](#input\_replicas\_per\_node\_group) | Specify the number of replica nodes in each node group. Valid values are 0 to 5. Changing this number will trigger an online resizing operation before other settings modifications. | `number` | `0` | no |
145145
| <a name="input_security_group_ids"></a> [security\_group\_ids](#input\_security\_group\_ids) | List of Security Groups. | `list(string)` | `[]` | no |
146+
| <a name="input_snapshot_name"></a> [snapshot\_name](#input\_snapshot\_name) | The name of a snapshot from which to restore data into the new node group. Changing the snapshot\_name forces a new resource. | `string` | `null` | no |
146147
| <a name="input_snapshot_retention_limit"></a> [snapshot\_retention\_limit](#input\_snapshot\_retention\_limit) | The number of days for which ElastiCache will retain automatic cache cluster snapshots before deleting them. | `number` | `30` | no |
147148
| <a name="input_snapshot_window"></a> [snapshot\_window](#input\_snapshot\_window) | The daily time range (in UTC) during which ElastiCache will begin taking a daily snapshot of your cache cluster. | `string` | `""` | no |
148149
| <a name="input_subnet_group_name"></a> [subnet\_group\_name](#input\_subnet\_group\_name) | The name of the subnet group. If it is not specified, the module will create one for you | `string` | `null` | no |

main.tf

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ resource "aws_elasticache_replication_group" "redis" {
2020
maintenance_window = var.maintenance_window
2121
snapshot_window = var.snapshot_window
2222
snapshot_retention_limit = var.snapshot_retention_limit
23+
snapshot_name = var.snapshot_name
2324
final_snapshot_identifier = var.final_snapshot_identifier
2425
automatic_failover_enabled = var.automatic_failover_enabled && var.num_cache_clusters >= 2 ? true : false
2526
auto_minor_version_upgrade = var.auto_minor_version_upgrade

variables.tf

+6
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,12 @@ variable "maintenance_window" {
7979
description = "Specifies the weekly time range for when maintenance on the cache cluster is performed."
8080
}
8181

82+
variable "snapshot_name" {
83+
type = string
84+
description = "The name of a snapshot from which to restore data into the new node group. Changing the snapshot_name forces a new resource."
85+
default = null
86+
}
87+
8288
variable "snapshot_window" {
8389
default = ""
8490
type = string

0 commit comments

Comments
 (0)