https://github.com/launchbynttdata/tf-aws-module_primitive-sns_topic_subscription
https://github.com/launchbynttdata/tf-aws-module_primitive-sns_topic_subscription
Last synced: 13 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/launchbynttdata/tf-aws-module_primitive-sns_topic_subscription
- Owner: launchbynttdata
- License: apache-2.0
- Created: 2026-03-20T15:27:18.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2026-04-06T14:08:28.000Z (3 months ago)
- Last Synced: 2026-04-06T16:04:25.624Z (3 months ago)
- Language: Go
- Size: 103 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: CODEOWNERS
- Notice: NOTICE
Awesome Lists containing this project
README
# tf-aws-module_primitive-sns_topic_subscription
[](https://opensource.org/licenses/Apache-2.0)
[](https://creativecommons.org/licenses/by-nc-nd/4.0/)
## Overview
Terraform primitive module that wraps a single [`aws_sns_topic_subscription`](https://registry.terraform.io/providers/hashicorp/aws/5.100.0/docs/resources/sns_topic_subscription) resource. It exposes the arguments and attributes supported by the AWS provider so callers can configure subscriptions without losing functionality.
## Usage
```hcl
module "sns_topic_subscription" {
source = "path/to/module"
topic_arn = aws_sns_topic.example.arn
protocol = "sqs"
endpoint = aws_sqs_queue.example.arn
raw_message_delivery = true
}
```
## Requirements
- Terraform `~> 1.9`
- AWS provider `~> 5.100` (see [`versions.tf`](./versions.tf))
## Examples
See [`examples/complete/`](./examples/complete/) for an end-to-end subscription from an SNS topic to an encrypted SQS queue.
## Contributing
Run `make configure` once to sync shared automation components, then use the standard targets from the included Makefile (for example `make lint`, `make check`).
Pre-commit hooks enforce formatting and documentation. Install with `pre-commit install` after `make configure`.
## Requirements
| Name | Version |
|------|---------|
| [terraform](#requirement\_terraform) | ~> 1.9 |
| [aws](#requirement\_aws) | ~> 5.100 |
## Providers
| Name | Version |
|------|---------|
| [aws](#provider\_aws) | 5.100.0 |
## Modules
No modules.
## Resources
| Name | Type |
|------|------|
| [aws_sns_topic_subscription.sns_topic_subscription](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/sns_topic_subscription) | resource |
## Inputs
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| [topic\_arn](#input\_topic\_arn) | ARN of the SNS topic to subscribe to. | `string` | n/a | yes |
| [protocol](#input\_protocol) | Protocol to use. Valid values include application, firehose, http, https, lambda, sms, sqs, email, email-json. | `string` | n/a | yes |
| [endpoint](#input\_endpoint) | Endpoint to send data to. The contents vary by protocol (e.g., SQS queue ARN, HTTPS URL, Lambda function ARN). | `string` | n/a | yes |
| [confirmation\_timeout\_in\_minutes](#input\_confirmation\_timeout\_in\_minutes) | Integer indicating the wait time for confirmation of an HTTP or HTTPS subscription. Only applicable when protocol is http or https. | `number` | `null` | no |
| [delivery\_policy](#input\_delivery\_policy) | JSON string for the subscription delivery policy (HTTP/S, SQS, etc.). | `string` | `null` | no |
| [endpoint\_auto\_confirms](#input\_endpoint\_auto\_confirms) | Whether the endpoint is capable of auto-confirming the subscription (e.g., some HTTPS endpoints). | `bool` | `null` | no |
| [filter\_policy](#input\_filter\_policy) | JSON string for the subscription filter policy. | `string` | `null` | no |
| [filter\_policy\_scope](#input\_filter\_policy\_scope) | Whether filter\_policy applies to MessageAttributes or MessageBody. | `string` | `null` | no |
| [raw\_message\_delivery](#input\_raw\_message\_delivery) | Whether to enable raw message delivery (supported for SQS, HTTP/S, and Firehose subscriptions). | `bool` | `null` | no |
| [redrive\_policy](#input\_redrive\_policy) | JSON string for the dead-letter queue redrive policy (SQS subscriptions). | `string` | `null` | no |
| [replay\_policy](#input\_replay\_policy) | JSON string for FIFO topic message replay policy. | `string` | `null` | no |
| [subscription\_role\_arn](#input\_subscription\_role\_arn) | IAM role ARN for Kinesis Firehose delivery to a subscription. | `string` | `null` | no |
## Outputs
| Name | Description |
|------|-------------|
| [id](#output\_id) | The ID of the subscription (same as the subscription ARN). |
| [arn](#output\_arn) | The ARN of the subscription. |
| [owner\_id](#output\_owner\_id) | The AWS account ID of the subscription owner. |
| [pending\_confirmation](#output\_pending\_confirmation) | Whether the subscription is pending confirmation. |
| [endpoint](#output\_endpoint) | The subscription endpoint (same as the configured endpoint argument). |
| [confirmation\_was\_authenticated](#output\_confirmation\_was\_authenticated) | Whether the subscription confirmation request was authenticated. |