Skip to content

Commit 4bbb55e

Browse files
committed
feat: update the module to support automated backup
1 parent ea1db15 commit 4bbb55e

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

main.tf

+5
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@ resource "aws_elasticache_replication_group" "this" {
7373

7474
user_group_ids = [var.user_group_id]
7575

76+
snapshot_retention_limit = var.instance_type != "cache.t1.micro" ? var.snapshot_retention_limit : 0
77+
snapshot_window = var.snapshot_window
78+
snapshot_arns = var.snapshot_arns
79+
snapshot_name = var.snapshot_name
80+
7681
tags = var.tags
7782
}
7883

variables.tf

+18
Original file line numberDiff line numberDiff line change
@@ -248,3 +248,21 @@ variable "user_group_id" {
248248
description = "The ID of the user group Elasticache"
249249
default = ""
250250
}
251+
252+
variable "snapshot_window" {
253+
type = string
254+
description = "The daily time range (in UTC) during which ElastiCache begins taking a daily snapshot of the node group (shard) specified by SnapshottingClusterId"
255+
default = "00:00-01:00"
256+
}
257+
258+
variable "snapshot_arns" {
259+
type = list(string)
260+
description = "The ARN of the snapshot from which to restore data into the new node group (shard)"
261+
default = []
262+
}
263+
264+
variable "snapshot_name" {
265+
type = string
266+
description = "The name of the snapshot from which to restore data into the new node group (shard)"
267+
default = ""
268+
}

0 commit comments

Comments
 (0)