Skip to content

Commit b7d59e3

Browse files
authored
feat: Add support for signature version (#42)
Co-authored-by: magreenbaum <magreenbaum>
1 parent b025824 commit b7d59e3

File tree

6 files changed

+14
-4
lines changed

6 files changed

+14
-4
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,13 +135,13 @@ module "sns_topic" {
135135
| Name | Version |
136136
|------|---------|
137137
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
138-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.40 |
138+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.56 |
139139

140140
## Providers
141141

142142
| Name | Version |
143143
|------|---------|
144-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.40 |
144+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.56 |
145145

146146
## Modules
147147

@@ -176,6 +176,7 @@ No modules.
176176
| <a name="input_lambda_feedback"></a> [lambda\_feedback](#input\_lambda\_feedback) | Map of IAM role ARNs and sample rate for success and failure feedback | `map(string)` | `{}` | no |
177177
| <a name="input_name"></a> [name](#input\_name) | The name of the SNS topic to create | `string` | `null` | no |
178178
| <a name="input_override_topic_policy_documents"></a> [override\_topic\_policy\_documents](#input\_override\_topic\_policy\_documents) | List of IAM policy documents that are merged together into the exported document. In merging, statements with non-blank `sid`s will override statements with the same `sid` | `list(string)` | `[]` | no |
179+
| <a name="input_signature_version"></a> [signature\_version](#input\_signature\_version) | If SignatureVersion should be 1 (SHA1) or 2 (SHA256). The signature version corresponds to the hashing algorithm used while creating the signature of the notifications, subscription confirmations, or unsubscribe confirmation messages sent by Amazon SNS. | `number` | `null` | no |
179180
| <a name="input_source_topic_policy_documents"></a> [source\_topic\_policy\_documents](#input\_source\_topic\_policy\_documents) | List of IAM policy documents that are merged together into the exported document. Statements must have unique `sid`s | `list(string)` | `[]` | no |
180181
| <a name="input_sqs_feedback"></a> [sqs\_feedback](#input\_sqs\_feedback) | Map of IAM role ARNs and sample rate for success and failure feedback | `map(string)` | `{}` | no |
181182
| <a name="input_subscriptions"></a> [subscriptions](#input\_subscriptions) | A map of subscription definitions to create | `any` | `{}` | no |

examples/complete/main.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ locals {
2222
module "default_sns" {
2323
source = "../../"
2424

25-
name = "${local.name}-default"
25+
name = "${local.name}-default"
26+
signature_version = 2
2627

2728
tags = local.tags
2829
}

main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ resource "aws_sns_topic" "this" {
1818
delivery_policy = var.delivery_policy
1919
display_name = var.display_name
2020
fifo_topic = var.fifo_topic
21+
signature_version = var.fifo_topic ? null : var.signature_version
2122

2223
firehose_failure_feedback_role_arn = try(var.firehose_feedback.failure_role_arn, null)
2324
firehose_success_feedback_role_arn = try(var.firehose_feedback.success_role_arn, null)

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,12 @@ variable "sqs_feedback" {
122122
# }
123123
}
124124

125+
variable "signature_version" {
126+
description = "If SignatureVersion should be 1 (SHA1) or 2 (SHA256). The signature version corresponds to the hashing algorithm used while creating the signature of the notifications, subscription confirmations, or unsubscribe confirmation messages sent by Amazon SNS."
127+
type = number
128+
default = null
129+
}
130+
125131
################################################################################
126132
# Topic Policy
127133
################################################################################

versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 4.40"
7+
version = ">= 4.56"
88
}
99
}
1010
}

wrappers/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ module "wrapper" {
1818
lambda_feedback = try(each.value.lambda_feedback, var.defaults.lambda_feedback, {})
1919
topic_policy = try(each.value.topic_policy, var.defaults.topic_policy, null)
2020
sqs_feedback = try(each.value.sqs_feedback, var.defaults.sqs_feedback, {})
21+
signature_version = try(each.value.signature_version, var.defaults.signature_version, null)
2122
create_topic_policy = try(each.value.create_topic_policy, var.defaults.create_topic_policy, true)
2223
source_topic_policy_documents = try(each.value.source_topic_policy_documents, var.defaults.source_topic_policy_documents, [])
2324
override_topic_policy_documents = try(each.value.override_topic_policy_documents, var.defaults.override_topic_policy_documents, [])

0 commit comments

Comments
 (0)