Skip to content

Commit ab660f7

Browse files
rysi3kTomasz Rychlewiczantonbabenko
authored
feat!: Added variable to filter body of message on SNS level and bumped min Terraform version to 1.0 (#196)
Co-authored-by: Tomasz Rychlewicz <tomasz.rychlewicz@explaineverything.com> Co-authored-by: Anton Babenko <anton@antonbabenko.com>
1 parent 1882017 commit ab660f7

File tree

9 files changed

+20
-12
lines changed

9 files changed

+20
-12
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/antonbabenko/pre-commit-terraform
3-
rev: v1.76.0
3+
rev: v1.79.1
44
hooks:
55
- id: terraform_fmt
66
- id: terraform_validate
@@ -23,7 +23,7 @@ repos:
2323
- '--args=--only=terraform_standard_module_structure'
2424
- '--args=--only=terraform_workspace_remote'
2525
- repo: https://github.com/pre-commit/pre-commit-hooks
26-
rev: v4.3.0
26+
rev: v4.4.0
2727
hooks:
2828
- id: check-merge-conflict
2929
- id: end-of-file-fixer

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ See the [functions](https://github.com/terraform-aws-modules/terraform-aws-notif
6464

6565
| Name | Version |
6666
|------|---------|
67-
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 |
67+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
6868
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.8 |
6969

7070
## Providers
@@ -141,6 +141,7 @@ See the [functions](https://github.com/terraform-aws-modules/terraform-aws-notif
141141
| <a name="input_sns_topic_name"></a> [sns\_topic\_name](#input\_sns\_topic\_name) | The name of the SNS topic to create | `string` | n/a | yes |
142142
| <a name="input_sns_topic_tags"></a> [sns\_topic\_tags](#input\_sns\_topic\_tags) | Additional tags for the SNS topic | `map(string)` | `{}` | no |
143143
| <a name="input_subscription_filter_policy"></a> [subscription\_filter\_policy](#input\_subscription\_filter\_policy) | (Optional) A valid filter policy that will be used in the subscription to filter messages seen by the target resource. | `string` | `null` | no |
144+
| <a name="input_subscription_filter_policy_scope"></a> [subscription\_filter\_policy\_scope](#input\_subscription\_filter\_policy\_scope) | (Optional) A valid filter policy scope MessageAttributes\|MessageBody | `string` | `null` | no |
144145
| <a name="input_tags"></a> [tags](#input\_tags) | A map of tags to add to all resources | `map(string)` | `{}` | no |
145146

146147
## Outputs

examples/cloudwatch-alerts-to-slack/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ Note that this example may create resources which can cost money. Run `terraform
6060

6161
| Name | Version |
6262
|------|---------|
63-
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 |
63+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
6464
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.8 |
6565
| <a name="requirement_random"></a> [random](#requirement\_random) | >= 2.0 |
6666

examples/cloudwatch-alerts-to-slack/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
terraform {
2-
required_version = ">= 0.13.1"
2+
required_version = ">= 1.0"
33

44
required_providers {
55
aws = {

examples/notify-slack-simple/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Note that this example may create resources which can cost money (AWS Elastic IP
2323

2424
| Name | Version |
2525
|------|---------|
26-
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 |
26+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
2727
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.8 |
2828
| <a name="requirement_local"></a> [local](#requirement\_local) | >= 2.0 |
2929

examples/notify-slack-simple/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
terraform {
2-
required_version = ">= 0.13.1"
2+
required_version = ">= 1.0"
33

44
required_providers {
55
aws = {

main.tf

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,11 @@ resource "aws_sns_topic" "this" {
7171
resource "aws_sns_topic_subscription" "sns_notify_slack" {
7272
count = var.create ? 1 : 0
7373

74-
topic_arn = local.sns_topic_arn
75-
protocol = "lambda"
76-
endpoint = module.lambda.lambda_function_arn
77-
filter_policy = var.subscription_filter_policy
74+
topic_arn = local.sns_topic_arn
75+
protocol = "lambda"
76+
endpoint = module.lambda.lambda_function_arn
77+
filter_policy = var.subscription_filter_policy
78+
filter_policy_scope = var.subscription_filter_policy_scope
7879
}
7980

8081
module "lambda" {

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,3 +263,9 @@ variable "subscription_filter_policy" {
263263
type = string
264264
default = null
265265
}
266+
267+
variable "subscription_filter_policy_scope" {
268+
description = "(Optional) A valid filter policy scope MessageAttributes|MessageBody"
269+
type = string
270+
default = null
271+
}

versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
terraform {
2-
required_version = ">= 0.13.1"
2+
required_version = ">= 1.0"
33

44
required_providers {
55
aws = {

0 commit comments

Comments
 (0)