Skip to content

Commit be85256

Browse files
author
Abdul Wahid
authored
Add a missing conditional (#11)
SNS topic should only be created if both conditions are met
1 parent 976339d commit be85256

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

main.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ resource "aws_backup_selection" "main" {
8686
# SNS Backup Notifications
8787
#######
8888
resource "aws_sns_topic" "main" {
89-
count = var.create_sns_topic ? 1 : 0
89+
count = var.create_sns_topic && var.enable_sns_notifications ? 1 : 0
9090

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

0 commit comments

Comments
 (0)