diff --git a/CHANGELOG.md b/CHANGELOG.md index 135cd3b..8393157 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -71,3 +71,5 @@ * 0.2.3 -- 2022-03-28 - code 0.2.2 fixes for json.loads and API limits (#20, #22) +* 0.2.4 -- 2022-03-28 + - add code to enable sqs diff --git a/README.md b/README.md index 60d7685..5d82a6f 100644 --- a/README.md +++ b/README.md @@ -141,7 +141,7 @@ No modules. | [create](#input\_create) | Flag to indicate whether to create the resources or not (default: true) | `bool` | `true` | no | | [dynamodb\_table\_name](#input\_dynamodb\_table\_name) | Different DynamoDB table name to override default of var.name | `string` | `null` | no | | [enable\_sns](#input\_enable\_sns) | Enable use of SNS for reporting errors | `bool` | `false` | no | -| [enable\_sqs](#input\_enable\_sqs) | Enable use of SQS for SNS to send errors | `bool` | `false` | no | +| [enable\_sqs](#input\_enable\_sqs) | Enable use of SQS for SNS to send errors. Requires the use of enable\_sns as well | `bool` | `false` | no | | [lambda\_environment\_variables](#input\_lambda\_environment\_variables) | Map of lambda environment variables and values | `map(string)` |
{
"DNS_RR_TimeToLive": 60,
"DynamoDBName": null,
"HeritageIdentifier": "dynr53",
"HeritageTXTRecordPrefix": "_txt",
"MaxApiRetry": 10,
"SleepTime": 60,
"SnsEnable": false,
"SnsTopicArn": "",
"TagKeyCname": "boc:dns:cname",
"TagKeyHostName": "boc:dns:name",
"TagKeyZone": "boc:dns:zone"
}
| no | | [lambda\_environment\_variables\_override](#input\_lambda\_environment\_variables\_override) | Map of lambda environment variables and values to override from the defaults | `map(string)` | `{}` | no | | [lambda\_name](#input\_lambda\_name) | Different Lambda name to override default of var.name | `string` | `null` | no | diff --git a/sqs.tf b/sqs.tf index 9e2911b..8f18e3d 100644 --- a/sqs.tf +++ b/sqs.tf @@ -1,5 +1,5 @@ locals { - sqs_name = var.sqs_queue_name != null ? var.sws_queue_name : local.name + sqs_name = var.sqs_queue_name != null ? var.sqs_queue_name : local.name enable_sqs = var.enable_sns && var.enable_sqs } @@ -113,6 +113,7 @@ data "aws_iam_policy_document" "queue_sqs" { } resource "aws_sns_topic_subscription" "queue" { + count = var.create && local.enable_sqs ? 1 : 0 protocol = "sqs" topic_arn = aws_sns_topic.topic[0].arn endpoint = aws_sqs_queue.queue[0].arn diff --git a/variables.tf b/variables.tf index 4177326..d98a927 100644 --- a/variables.tf +++ b/variables.tf @@ -59,7 +59,7 @@ variable "enable_sns" { } variable "enable_sqs" { - description = "Enable use of SQS for SNS to send errors" + description = "Enable use of SQS for SNS to send errors. Requires the use of enable_sns as well" type = bool default = false } diff --git a/version.tf b/version.tf index 7015a93..c0869d8 100644 --- a/version.tf +++ b/version.tf @@ -1,3 +1,3 @@ locals { - _module_version = "0.2.3" + _module_version = "0.2.4" }