Skip to content

Commit

Permalink
restore from snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
ben851 committed Aug 20, 2024
1 parent 975e0a1 commit b893e34
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions aws/rds/rds.tf
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ resource "aws_rds_cluster" "notification-canada-ca" {
preferred_backup_window = "07:00-09:00"
preferred_maintenance_window = "wed:04:00-wed:04:30"
db_subnet_group_name = aws_db_subnet_group.notification-canada-ca.name

snapshot_identifier = var.recovery == true ? var.rds_snapshot_identifier : null

#tfsec:ignore:AWS051 - database is encrypted without a custom key and that's fine
storage_encrypted = true
deletion_protection = var.enable_delete_protection
Expand Down
11 changes: 11 additions & 0 deletions aws/rds/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,15 @@ variable "rds_version" {
type = string
description = "The version of the RDS instance."
default = "15.5"
}

variable "recovery" {
type = bool
description = "Set to true if you want to recover from a snapshot."
default = false
}

variable "rds_snapshot_identifier" {
type = string
description = "The snapshot identifier to recover from."
}

0 comments on commit b893e34

Please sign in to comment.