Skip to content

Commit

Permalink
TM-770 Remove vault used for migrating EFS
Browse files Browse the repository at this point in the history
  • Loading branch information
vc13837 committed Dec 13, 2024
1 parent 39d5d83 commit cca3961
Showing 1 changed file with 0 additions and 58 deletions.
58 changes: 0 additions & 58 deletions terraform/environments/apex/backups.tf
Original file line number Diff line number Diff line change
@@ -1,61 +1,3 @@
############################################################################
## This following is used to create a backup vault for migrating EFS data only
## Resources here can be removed after data migration
############################################################################

resource "aws_backup_vault" "apex" {
name = "${local.application_name}-backup-vault"
tags = merge(
local.tags,
{ "Name" = "${local.application_name}-backup-vault" },
)
}

data "aws_iam_policy_document" "apex" {
statement {
sid = "Allow local account basic permissions to the vault"
effect = "Allow"

principals {
type = "AWS"
identifiers = ["arn:aws:iam::${local.environment_management.account_ids[terraform.workspace]}:root"]
}

actions = [
"backup:DescribeBackupVault",
"backup:PutBackupVaultAccessPolicy",
"backup:DeleteBackupVaultAccessPolicy",
"backup:GetBackupVaultAccessPolicy",
"backup:StartBackupJob",
"backup:GetBackupVaultNotifications",
"backup:PutBackupVaultNotifications",
"backup:StartRestoreJob"
]

resources = [aws_backup_vault.apex.arn]
}
statement {
sid = "Allow copying of recovery points from Landing Zone"
effect = "Allow"

principals {
type = "AWS"
identifiers = ["arn:aws:iam::${local.application_data.accounts[local.environment].lz_account_id}:root"]
}

actions = [
"backup:CopyIntoBackupVault"
]

resources = [aws_backup_vault.apex.arn]
}
}

resource "aws_backup_vault_policy" "apex" {
backup_vault_name = aws_backup_vault.apex.name
policy = data.aws_iam_policy_document.apex.json
}

############################################################################
## This following is required for setting up backup for production
############################################################################
Expand Down

0 comments on commit cca3961

Please sign in to comment.