An open API service indexing awesome lists of open source software.

https://github.com/wearetechnative/terraform-aws-sns

AWS SNS module based on currently known best practices
https://github.com/wearetechnative/terraform-aws-sns

Last synced: about 1 month ago
JSON representation

AWS SNS module based on currently known best practices

Awesome Lists containing this project

README

          

# Terraform AWS [SNS]

This module implements a simple SNS topic with all known AWS best practices enforced.

[![](we-are-technative.png)](https://www.technative.nl)

## How does it work

### First use after you clone this repository or when .pre-commit-config.yaml is updated

Run `pre-commit install` to install any guardrails implemented using pre-commit.

See [pre-commit installation](https://pre-commit.com/#install) on how to install pre-commit.

## Usage

The simplest way to use this module is by defining the least required defaults:

```hcl
module "sns_topic_example" {
source = "git@github.com:TechNative-B-V/terraform-aws-module-sns.git?ref=f910b2174690733ed11bdb992521c9ea2358c6f2"

name = "sns_topic_example"
kms_key_arn = module.kms.kms_key_arn
}
```

## Providers

| Name | Version |
|------|---------|
| [aws](#provider\_aws) | >=4.21.0 |

## Modules

No modules.

## Resources

| Name | Type |
|------|------|
| [aws_sns_topic.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/sns_topic) | resource |
| [aws_sns_topic_policy.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/sns_topic_policy) | resource |
| [aws_caller_identity.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) | data source |
| [aws_iam_policy_document.combined](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |
| [aws_iam_policy_document.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| [kms\_key\_arn](#input\_kms\_key\_arn) | KMS key to use for encrypting SNS topics. If not provided then alias/aws/sns is used as a default. Set to null to dsiable entire (not recommended!). | `string` | `"alias/aws/sns"` | no |
| [name](#input\_name) | Unique name to assign to SNS topic. | `string` | n/a | yes |
| [policy\_allowed](#input\_policy\_allowed) | Required policy for SNS topic. |

map(object({
principal = object({
type = string
identities = list(string)
})
actions = list(string)
}))
| `{}` | no |

## Outputs

| Name | Description |
|------|-------------|
| [sns\_arn](#output\_sns\_arn) | n/a |