Skip to content

Commit

Permalink
ncr: TM-738: efs backup fix (#8963)
Browse files Browse the repository at this point in the history
* opt into daily and weekly backup

* disable default backup

* fix
  • Loading branch information
drobinson-moj authored Dec 4, 2024
1 parent 2012ff6 commit 224377c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ locals {
security_groups = ["bip"]
}]
tags = {
backup = "false"
backup = "false"
backup-plan = "daily-and-weekly"
}
}
}
Expand Down
11 changes: 10 additions & 1 deletion terraform/modules/efs/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ resource "aws_efs_file_system" "this" {
provisioned_throughput_in_mibps = var.file_system.provisioned_throughput_in_mibps
throughput_mode = var.file_system.throughput_mode

# annoyingly you have to define each option as separate block
# annoyingly you have to define each option as separate block
dynamic "lifecycle_policy" {
for_each = var.file_system.lifecycle_policy.transition_to_archive != null ? [var.file_system.lifecycle_policy] : []
content {
Expand All @@ -66,6 +66,15 @@ resource "aws_efs_file_system" "this" {
})
}

# disable automatic backups - use mod platform everything vault instead
resource "aws_efs_backup_policy" "policy" {
file_system_id = aws_efs_file_system.this.id

backup_policy {
status = "DISABLED"
}
}

data "aws_iam_policy_document" "this" {
count = var.policy != null ? 1 : 0

Expand Down

0 comments on commit 224377c

Please sign in to comment.