https://github.com/dod-iac/terraform-aws-sns-topic
AWS SNS Topic
https://github.com/dod-iac/terraform-aws-sns-topic
aws sns terraform
Last synced: about 1 year ago
JSON representation
AWS SNS Topic
- Host: GitHub
- URL: https://github.com/dod-iac/terraform-aws-sns-topic
- Owner: dod-iac
- License: mit
- Created: 2020-10-26T13:52:23.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-08-20T14:06:13.000Z (almost 4 years ago)
- Last Synced: 2025-02-26T12:14:56.050Z (over 1 year ago)
- Topics: aws, sns, terraform
- Language: HCL
- Homepage: https://registry.terraform.io/modules/dod-iac/sns-topic/aws
- Size: 13.7 KB
- Stars: 1
- Watchers: 5
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Usage
Creates an AWS SNS Topic that allows publishing from CloudWatch Events.
```hcl
module "alerts" {
source = "dod-iac/sns-topic/aws"
name = format("alerts-%s-%s", var.application, var.environment)
tags = {
Application = var.application
Environment = var.environment
Automation = "Terraform"
}
}
```
To create a SNS topic that uses server side encryption, you first need to create a KMS key.
```hcl
module "alerts_kms_key" {
source = "dod-iac/sns-kms-key/aws"
name = format("alerts-%s-%s", var.application, var.environment)
tags = {
Application = var.application
Environment = var.environment
Automation = "Terraform"
}
}
module "alerts" {
source = "dod-iac/sns-topic/aws"
name = format("alerts-%s-%s", var.application, var.environment)
kms_master_key_id = module.alerts_kms_key.aws_kms_key_arn
tags = {
Application = var.application
Environment = var.environment
Automation = "Terraform"
}
}
```
## Terraform Version
Terraform 0.12. Pin module version to ~> 1.0.0 . Submit pull-requests to master branch.
Terraform 0.11 is not supported.
## License
This project constitutes a work of the United States Government and is not subject to domestic copyright protection under 17 USC § 105. However, because the project utilizes code licensed from contributors and other third parties, it therefore is licensed under the MIT License. See LICENSE file for more information.
## Requirements
| Name | Version |
|------|---------|
| terraform | >= 0.13 |
| aws | ~> 3.0 |
## Providers
| Name | Version |
|------|---------|
| aws | ~> 3.0 |
## Modules
No Modules.
## Resources
| Name |
|------|
| [aws_caller_identity](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) |
| [aws_iam_policy_document](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) |
| [aws_partition](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/partition) |
| [aws_region](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/region) |
| [aws_sns_topic](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/sns_topic) |
## Inputs
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| access\_policy\_document | The contents of the access policy attached to the SNS topic. If not defined, then generates a policy using the "allow\_*" variables. | `string` | `""` | no |
| allow\_cloudwatch\_events | Allow CloudWatch events to publish to the SNS topic. | `bool` | `true` | no |
| kms\_master\_key\_id | The ID of an AWS-managed customer master key (CMK) for Amazon SNS or a custom CMK. | `string` | `null` | no |
| lambda\_failure\_feedback\_role\_arn | IAM role for failure feedback | `string` | `null` | no |
| lambda\_success\_feedback\_role\_arn | The IAM role permitted to receive success feedback for this topic | `string` | `null` | no |
| lambda\_success\_feedback\_sample\_rate | Percentage of success to sample | `number` | `null` | no |
| name | n/a | `string` | n/a | yes |
| tags | A mapping of tags to assign to the SNS Topic. | `map(string)` |
{
"Automation": "Terraform"
} | no |
## Outputs
| Name | Description |
|------|-------------|
| arn | The ARN of the SNS topic. |
| name | The name of the SNS topic. |