From 05846d9b3dc5c194543c25812f55caaf70bd054c Mon Sep 17 00:00:00 2001 From: xpk Date: Tue, 30 Apr 2024 10:54:57 +0800 Subject: [PATCH] UPD: added cold storage support for monthly backup rule --- modules/storage/aws-backup/main.tf | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/storage/aws-backup/main.tf b/modules/storage/aws-backup/main.tf index 0b92017..0a6b982 100644 --- a/modules/storage/aws-backup/main.tf +++ b/modules/storage/aws-backup/main.tf @@ -117,7 +117,8 @@ resource "aws_backup_plan" "ab-plan" { } } - # monthly backup (takes precedence than daily) + # monthly backup (when overlap with daily, only monthly backup will be created. + # see https://docs.aws.amazon.com/aws-backup/latest/devguide/creating-a-backup-plan.html) rule { rule_name = "Monthly" target_vault_name = each.value.name @@ -127,6 +128,7 @@ resource "aws_backup_plan" "ab-plan" { lifecycle { delete_after = var.monthly-backup-retention + cold_storage_after = var.daily-backup-retention # move to cold storage after daily retention } recovery_point_tags = {