Skip to content

Commit

Permalink
use a variable for delete_after
Browse files Browse the repository at this point in the history
  • Loading branch information
briskt committed Nov 11, 2024
1 parent d053038 commit dfbde43
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions terraform/032-db-backup/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ This module is used to run mysqldump and backup files to S3
- `cpu` - CPU resources to allot to each task instance
- `cron_schedule` - Schedule for CRON execution. DEPRECATED: use event_schedule`
- `event_schedule` - Schedule for backup task execution. Default: `cron(0 2 * * ? *)`
- `delete_recovery_point_after_days` - Number of days after which AWS Backup recovery points are deleted. Default: 100
- `db_names` - List of database names to backup. Default: `["emailservice", "idbroker", "pwmanager", "ssp"]`
- `memory` - Memory (RAM) resources to allot to each task instance
- `service_mode` - Either `backup` or `restore`. Default: `backup`
Expand Down
3 changes: 2 additions & 1 deletion terraform/032-db-backup/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ module "aws_backup" {
notification_events = var.aws_backup_notification_events
sns_topic_name = "${var.idp_name}-backup-vault-events"
sns_email_subscription = var.backup_sns_email
delete_after = 4
cold_storage_after = 0
delete_after = var.delete_recovery_point_after_days
}

data "aws_db_instance" "this" {
Expand Down
6 changes: 6 additions & 0 deletions terraform/032-db-backup/vars.tf
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,9 @@ variable "backup_sns_email" {
type = string
default = ""
}

variable "delete_recovery_point_after_days" {
description = "Number of days after which AWS Backup recovery points are deleted"
type = number
default = 100
}

0 comments on commit dfbde43

Please sign in to comment.