Skip to content

Commit b58395e

Browse files
committed
Add optional backup window to database
1 parent a927bd1 commit b58395e

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

modules/datastore/rds.tf

+3
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ resource "aws_rds_cluster" "this" {
7171
engine_version = var.db_engine_version
7272
storage_encrypted = true
7373

74+
backup_retention_period = var.backup_retention_period
75+
preferred_backup_window = var.preferred_backup_window
76+
7477
final_snapshot_identifier = "${var.resource_prefix}${var.db_name}-final-snapshot${var.resource_suffix}-${random_pet.final_snapshot_id.id}" # Snapshot upon delete
7578
vpc_security_group_ids = [aws_security_group.rds_security_group.id]
7679

modules/datastore/variables.tf

+12
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,15 @@ variable "enable_versioning" {
7777
description = "Enable versioning for S3 bucket"
7878
default = false
7979
}
80+
81+
variable "backup_retention_period" {
82+
description = "The days to retain backups for"
83+
type = number
84+
default = null
85+
}
86+
87+
variable "preferred_backup_window" {
88+
description = "The daily time range during which automated backups are created if automated backups are enabled using the `backup_retention_period` parameter. Time in UTC"
89+
type = string
90+
default = "02:00-03:00"
91+
}

0 commit comments

Comments
 (0)