Skip to content

Commit

Permalink
Add a missing conditional (#11)
Browse files Browse the repository at this point in the history
SNS topic should only be created if both conditions are met
  • Loading branch information
Abdul Wahid authored Apr 28, 2021
1 parent 976339d commit be85256
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ resource "aws_backup_selection" "main" {
# SNS Backup Notifications
#######
resource "aws_sns_topic" "main" {
count = var.create_sns_topic ? 1 : 0
count = var.create_sns_topic && var.enable_sns_notifications ? 1 : 0

name = var.vault_name != null ? "${aws_backup_vault.main[0].name}-events" : "backup-vault-events"
kms_master_key_id = var.vault_sns_kms_key_arn
Expand Down

0 comments on commit be85256

Please sign in to comment.