Skip to content

Commit f9269fb

Browse files
authored
feat!: Upgrade AWS provider and min required Terraform version to 6.9 and 1.5.7 respectively (#68)
1 parent 544e312 commit f9269fb

File tree

9 files changed

+183
-140
lines changed

9 files changed

+183
-140
lines changed

README.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -134,14 +134,14 @@ module "sns_topic" {
134134

135135
| Name | Version |
136136
|------|---------|
137-
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
138-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.98 |
137+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.5.7 |
138+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 6.9 |
139139

140140
## Providers
141141

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

146146
## Modules
147147

@@ -162,9 +162,9 @@ No modules.
162162

163163
| Name | Description | Type | Default | Required |
164164
|------|-------------|------|---------|:--------:|
165-
| <a name="input_application_feedback"></a> [application\_feedback](#input\_application\_feedback) | Map of IAM role ARNs and sample rate for success and failure feedback | `map(string)` | `{}` | no |
166-
| <a name="input_archive_policy"></a> [archive\_policy](#input\_archive\_policy) | The message archive policy for FIFO topics. | `string` | `null` | no |
167-
| <a name="input_content_based_deduplication"></a> [content\_based\_deduplication](#input\_content\_based\_deduplication) | Boolean indicating whether or not to enable content-based deduplication for FIFO topics. | `bool` | `false` | no |
165+
| <a name="input_application_feedback"></a> [application\_feedback](#input\_application\_feedback) | Map of IAM role ARNs and sample rate for success and failure feedback | <pre>object({<br/> failure_role_arn = optional(string)<br/> success_role_arn = optional(string)<br/> success_sample_rate = optional(number)<br/> })</pre> | `{}` | no |
166+
| <a name="input_archive_policy"></a> [archive\_policy](#input\_archive\_policy) | The message archive policy for FIFO topics | `string` | `null` | no |
167+
| <a name="input_content_based_deduplication"></a> [content\_based\_deduplication](#input\_content\_based\_deduplication) | Boolean indicating whether or not to enable content-based deduplication for FIFO topics | `bool` | `false` | no |
168168
| <a name="input_create"></a> [create](#input\_create) | Determines whether resources will be created (affects all resources) | `bool` | `true` | no |
169169
| <a name="input_create_subscription"></a> [create\_subscription](#input\_create\_subscription) | Determines whether an SNS subscription is created | `bool` | `true` | no |
170170
| <a name="input_create_topic_policy"></a> [create\_topic\_policy](#input\_create\_topic\_policy) | Determines whether an SNS topic policy is created | `bool` | `true` | no |
@@ -174,20 +174,21 @@ No modules.
174174
| <a name="input_enable_default_topic_policy"></a> [enable\_default\_topic\_policy](#input\_enable\_default\_topic\_policy) | Specifies whether to enable the default topic policy. Defaults to `true` | `bool` | `true` | no |
175175
| <a name="input_fifo_throughput_scope"></a> [fifo\_throughput\_scope](#input\_fifo\_throughput\_scope) | Enables higher throughput for FIFO topics by adjusting the scope of deduplication. This attribute has two possible values, Topic and MessageGroup | `string` | `null` | no |
176176
| <a name="input_fifo_topic"></a> [fifo\_topic](#input\_fifo\_topic) | Boolean indicating whether or not to create a FIFO (first-in-first-out) topic | `bool` | `false` | no |
177-
| <a name="input_firehose_feedback"></a> [firehose\_feedback](#input\_firehose\_feedback) | Map of IAM role ARNs and sample rate for success and failure feedback | `map(string)` | `{}` | no |
178-
| <a name="input_http_feedback"></a> [http\_feedback](#input\_http\_feedback) | Map of IAM role ARNs and sample rate for success and failure feedback | `map(string)` | `{}` | no |
177+
| <a name="input_firehose_feedback"></a> [firehose\_feedback](#input\_firehose\_feedback) | Map of IAM role ARNs and sample rate for success and failure feedback | <pre>object({<br/> failure_role_arn = optional(string)<br/> success_role_arn = optional(string)<br/> success_sample_rate = optional(number)<br/> })</pre> | `{}` | no |
178+
| <a name="input_http_feedback"></a> [http\_feedback](#input\_http\_feedback) | Map of IAM role ARNs and sample rate for success and failure feedback | <pre>object({<br/> failure_role_arn = optional(string)<br/> success_role_arn = optional(string)<br/> success_sample_rate = optional(number)<br/> })</pre> | `{}` | no |
179179
| <a name="input_kms_master_key_id"></a> [kms\_master\_key\_id](#input\_kms\_master\_key\_id) | The ID of an AWS-managed customer master key (CMK) for Amazon SNS or a custom CMK | `string` | `null` | no |
180-
| <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 |
180+
| <a name="input_lambda_feedback"></a> [lambda\_feedback](#input\_lambda\_feedback) | Map of IAM role ARNs and sample rate for success and failure feedback | <pre>object({<br/> failure_role_arn = optional(string)<br/> success_role_arn = optional(string)<br/> success_sample_rate = optional(number)<br/> })</pre> | `{}` | no |
181181
| <a name="input_name"></a> [name](#input\_name) | The name of the SNS topic to create | `string` | `null` | no |
182182
| <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 |
183-
| <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 |
183+
| <a name="input_region"></a> [region](#input\_region) | Region where the resource(s) will be managed. Defaults to the Region set in the provider configuration | `string` | `null` | no |
184+
| <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 |
184185
| <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 |
185-
| <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 |
186-
| <a name="input_subscriptions"></a> [subscriptions](#input\_subscriptions) | A map of subscription definitions to create | `any` | `{}` | no |
186+
| <a name="input_sqs_feedback"></a> [sqs\_feedback](#input\_sqs\_feedback) | Map of IAM role ARNs and sample rate for success and failure feedback | <pre>object({<br/> failure_role_arn = optional(string)<br/> success_role_arn = optional(string)<br/> success_sample_rate = optional(number)<br/> })</pre> | `{}` | no |
187+
| <a name="input_subscriptions"></a> [subscriptions](#input\_subscriptions) | A map of subscription definitions to create | <pre>map(object({<br/> confirmation_timeout_in_minutes = optional(number)<br/> delivery_policy = optional(string)<br/> endpoint = string<br/> endpoint_auto_confirms = optional(bool)<br/> filter_policy = optional(string)<br/> filter_policy_scope = optional(string)<br/> protocol = string<br/> raw_message_delivery = optional(bool)<br/> redrive_policy = optional(string)<br/> replay_policy = optional(string)<br/> subscription_role_arn = optional(string)<br/> }))</pre> | `{}` | no |
187188
| <a name="input_tags"></a> [tags](#input\_tags) | A map of tags to add to all resources | `map(string)` | `{}` | no |
188189
| <a name="input_topic_policy"></a> [topic\_policy](#input\_topic\_policy) | An externally created fully-formed AWS policy as JSON | `string` | `null` | no |
189-
| <a name="input_topic_policy_statements"></a> [topic\_policy\_statements](#input\_topic\_policy\_statements) | A map of IAM policy [statements](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document#statement) for custom permission usage | `any` | `{}` | no |
190-
| <a name="input_tracing_config"></a> [tracing\_config](#input\_tracing\_config) | Tracing mode of an Amazon SNS topic. Valid values: PassThrough, Active. | `string` | `null` | no |
190+
| <a name="input_topic_policy_statements"></a> [topic\_policy\_statements](#input\_topic\_policy\_statements) | A map of IAM policy [statements](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document#statement) for custom permission usage | <pre>map(object({<br/> sid = optional(string)<br/> actions = optional(list(string))<br/> not_actions = optional(list(string))<br/> effect = optional(string, "Allow")<br/> resources = optional(list(string))<br/> not_resources = optional(list(string))<br/> principals = optional(list(object({<br/> type = string<br/> identifiers = list(string)<br/> })))<br/> not_principals = optional(list(object({<br/> type = string<br/> identifiers = list(string)<br/> })))<br/> condition = optional(list(object({<br/> test = string<br/> variable = string<br/> values = list(string)<br/> })))<br/> }))</pre> | `null` | no |
191+
| <a name="input_tracing_config"></a> [tracing\_config](#input\_tracing\_config) | Tracing mode of an Amazon SNS topic. Valid values: `PassThrough`, `Active` | `string` | `null` | no |
191192
| <a name="input_use_name_prefix"></a> [use\_name\_prefix](#input\_use\_name\_prefix) | Determines whether `name` is used as a prefix | `bool` | `false` | no |
192193

193194
## Outputs

examples/complete/README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Complete SNS topic example
22

33
Configuration in this directory creates:
4+
45
- A simple, default SNS topic
56
- A FIFO SNS topic with FIFO SQS subscription; shows most of the supported arguments
67
- A disabled SNS topic
@@ -10,9 +11,9 @@ Configuration in this directory creates:
1011
To run this example you need to execute:
1112

1213
```bash
13-
$ terraform init
14-
$ terraform plan
15-
$ terraform apply
14+
terraform init
15+
terraform plan
16+
terraform apply
1617
```
1718

1819
Note that this example may create resources which cost money. Run `terraform destroy` when you don't need these resources.
@@ -22,14 +23,14 @@ Note that this example may create resources which cost money. Run `terraform des
2223

2324
| Name | Version |
2425
|------|---------|
25-
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
26-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.98 |
26+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.5.7 |
27+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 6.9 |
2728

2829
## Providers
2930

3031
| Name | Version |
3132
|------|---------|
32-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.98 |
33+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 6.9 |
3334

3435
## Modules
3536

@@ -38,14 +39,15 @@ Note that this example may create resources which cost money. Run `terraform des
3839
| <a name="module_complete_sns"></a> [complete\_sns](#module\_complete\_sns) | ../../ | n/a |
3940
| <a name="module_default_sns"></a> [default\_sns](#module\_default\_sns) | ../../ | n/a |
4041
| <a name="module_disabled_sns"></a> [disabled\_sns](#module\_disabled\_sns) | ../../ | n/a |
41-
| <a name="module_kms"></a> [kms](#module\_kms) | terraform-aws-modules/kms/aws | ~> 1.0 |
42-
| <a name="module_sqs"></a> [sqs](#module\_sqs) | terraform-aws-modules/sqs/aws | ~> 4.0 |
42+
| <a name="module_kms"></a> [kms](#module\_kms) | terraform-aws-modules/kms/aws | ~> 4.0 |
43+
| <a name="module_sqs"></a> [sqs](#module\_sqs) | terraform-aws-modules/sqs/aws | ~> 5.0 |
4344

4445
## Resources
4546

4647
| Name | Type |
4748
|------|------|
4849
| [aws_iam_role.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource |
50+
| [aws_iam_role_policy.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy) | resource |
4951
| [aws_caller_identity.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) | data source |
5052

5153
## Inputs

examples/complete/main.tf

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ data "aws_caller_identity" "current" {}
66

77
locals {
88
region = "eu-west-1"
9-
name = "sns-ex-${basename(path.cwd)}"
9+
name = "ex-${basename(path.cwd)}"
1010

1111
tags = {
1212
Name = local.name
13-
Example = "complete"
14-
Repository = "github.com/terraform-aws-modules/terraform-aws-sns"
13+
Example = local.name
14+
Repository = "https://github.com/terraform-aws-modules/terraform-aws-sns"
1515
}
1616
}
1717

@@ -113,7 +113,7 @@ module "complete_sns" {
113113
identifiers = ["*"]
114114
}]
115115

116-
conditions = [{
116+
condition = [{
117117
test = "StringLike"
118118
variable = "sns:Endpoint"
119119
values = [module.sqs.queue_arn]
@@ -177,7 +177,7 @@ module "disabled_sns" {
177177

178178
module "kms" {
179179
source = "terraform-aws-modules/kms/aws"
180-
version = "~> 1.0"
180+
version = "~> 4.0"
181181

182182
aliases = ["sns/${local.name}"]
183183
description = "KMS key to encrypt topic"
@@ -203,7 +203,7 @@ module "kms" {
203203

204204
module "sqs" {
205205
source = "terraform-aws-modules/sqs/aws"
206-
version = "~> 4.0"
206+
version = "~> 5.0"
207207

208208
name = local.name
209209
fifo_queue = true
@@ -251,26 +251,27 @@ resource "aws_iam_role" "this" {
251251
]
252252
})
253253

254-
inline_policy {
255-
name = local.name
254+
tags = local.tags
255+
}
256256

257-
policy = jsonencode({
258-
Version = "2012-10-17"
259-
Statement = [
260-
{
261-
Action = [
262-
"logs:CreateLogGroup",
263-
"logs:CreateLogStream",
264-
"logs:PutLogEvents",
265-
"logs:PutMetricFilter",
266-
"logs:PutRetentionPolicy",
267-
]
268-
Effect = "Allow"
269-
Resource = "*"
270-
},
271-
]
272-
})
273-
}
257+
resource "aws_iam_role_policy" "this" {
258+
name = local.name
259+
role = aws_iam_role.this.id
274260

275-
tags = local.tags
261+
policy = jsonencode({
262+
Version = "2012-10-17"
263+
Statement = [
264+
{
265+
Action = [
266+
"logs:CreateLogGroup",
267+
"logs:CreateLogStream",
268+
"logs:PutLogEvents",
269+
"logs:PutMetricFilter",
270+
"logs:PutRetentionPolicy",
271+
]
272+
Effect = "Allow"
273+
Resource = "*"
274+
},
275+
]
276+
})
276277
}

examples/complete/versions.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
terraform {
2-
required_version = ">= 1.0"
2+
required_version = ">= 1.5.7"
33

44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 5.98"
7+
version = ">= 6.9"
88
}
99
}
1010
}

0 commit comments

Comments
 (0)