Skip to content

Commit

Permalink
Merge pull request #70 from igorzi84/master
Browse files Browse the repository at this point in the history
Add force-destroy flag to backup vault
  • Loading branch information
lgallard authored Feb 28, 2023
2 parents b991150 + 4382dd1 commit 227cd69
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
9 changes: 5 additions & 4 deletions main.tf
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# AWS Backup vault
resource "aws_backup_vault" "ab_vault" {
count = var.enabled && var.vault_name != null ? 1 : 0
name = var.vault_name
kms_key_arn = var.vault_kms_key_arn
tags = var.tags
count = var.enabled && var.vault_name != null ? 1 : 0
name = var.vault_name
kms_key_arn = var.vault_kms_key_arn
force_delete = var.vault_force_delete
tags = var.tags
}

# AWS Backup plan
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ variable "tags" {
default = {}
}

variable "vault_force_delete" {
description = "Force delete the backup vault even if it contains recovery points"
type = bool
default = false
}

#
# AWS Backup plan
#
Expand Down
2 changes: 1 addition & 1 deletion versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 3.0"
version = ">= 4.26"
}
}
}

0 comments on commit 227cd69

Please sign in to comment.