Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,28 +41,4 @@ data "aws_iam_policy_document" "vault_policy" {
resources = ["*"]
}
}

dynamic "statement" {
for_each = var.enable_vault_protection ? [1] : []
content {
sid = "DenyBackupCopyExceptToSourceAccount"
effect = "Deny"

principals {
type = "AWS"
identifiers = ["arn:aws:iam::${var.account_id}:root"]
}
actions = [
"backup:CopyFromBackupVault"
]
resources = ["*"]
condition {
test = "StringNotEquals"
variable = "backup:CopyTargets"
values = [
"arn:aws:backup:${var.region}:${var.source_account_id}:backup-vault:${var.region}-${var.source_account_id}-backup-vault"
]
}
}
}
}
3 changes: 2 additions & 1 deletion terraform/backup-infrastructure/prod/aws-backup.tf
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ module "destination" {
account_id = local.destination_account_id
source_account_id = local.source_account_id
kms_key = aws_kms_key.destination_backup_key.arn
enable_vault_protection = false
enable_vault_protection = true
vault_lock_type = "compliance"
}

###
Expand Down
Loading