Skip to content

Commit 5beb00b

Browse files
Merge pull request #24 from scribd/PE-5493-oxbow-fix
PE-5493:fix:ensuring no resource when enable auto tagging is false
2 parents ed4bb03 + 8f9c335 commit 5beb00b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

autotagging.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ resource "aws_sqs_queue" "auto_tagging" {
5050
}
5151

5252
resource "aws_sns_topic_subscription" "auto_tagging" {
53-
count = var.sns_topic_arn == "" ? 0 : 1
53+
count = var.enable_auto_tagging == true ? var.sns_topic_arn == "" ? 0 : 1 : 0
5454

5555
topic_arn = var.sns_topic_arn
5656
protocol = "sqs"
@@ -99,7 +99,7 @@ data "aws_iam_policy_document" "auto_tagging_sqs" {
9999
}
100100

101101
data "aws_iam_policy_document" "auto_tagging_sns" {
102-
count = var.sns_topic_arn == "" ? 0 : 1
102+
count = var.enable_auto_tagging == true ? var.sns_topic_arn == "" ? 0 : 1 : 0
103103

104104
statement {
105105
effect = "Allow"

0 commit comments

Comments
 (0)