Terraform Module for SNS Topic and List of Emails
Terraform supports most AWS SNS resource options except for email or email-json protocols. Because the email needs to be confirmed, it becomes out of the normal bounds of the terraform model so it does not support it.
This module creates an SNS email topic via a CloudFormation that outputs the ARN for use elsewhere.
Use the module in your terraform files:
module "sns-email-topic" {
source = "github.com/zghafari/tf-sns-email-list"
display_name = "Example: CloudWatch Alerts"
email_addresses = ["user1@example.com", "user2@example.com"]
stack_name = "unique-sns-stack-name"
}
run terraform init
to download the module.
Once you've applied it you can check the value with
terraform output -module=sns-email-topic arn
Name | Description | Type | Default | Required |
---|---|---|---|---|
display_name | Name shown in confirmation emails | string | - | yes |
email_addresses | Email address to send notifications to | list | - | yes |
protocol | SNS Protocol to use, for email use - email or email-json | string | email |
no |
stack_name | Unique Cloudformation stack name that wraps the SNS topic. | string | - | yes |
Name | Description |
---|---|
arn | Email SNS topic ARN |