SNS Topic Basic
π¦ Overviewβ
This Terraform module provisions a basic Amazon SNS topic, allowing for distributed pub/sub messaging across systems and services.
Itβs ideal for enabling alerting, automation triggers, and decoupled communication between AWS services or microservices.
β Key Featuresβ
- Creates a named SNS topic in the specified region
- Supports optional display name and KMS encryption
- Enables integration with Lambda, SQS, Email, and more
- Facilitates cross-service event distribution and notifications
πΌ Use Casesβ
- Broadcasting system alerts or application notifications
- Decoupling services using pub/sub patterns
- Routing messages from one system to multiple subscribers
- Triggering workflows like Lambda functions, Step Functions, or Ops pipelines
π₯ Input Variablesβ
| Name | Type | Description |
|---|---|---|
region | string | AWS region where the SNS topic will be created |
topic_name | string | Name of the SNS topic |
display_name | string | (Optional) Display name for SMS-based topics |
kms_key_arn | string | (Optional) ARN of the KMS key to enable encryption |
environment | string | Tag to specify the deployment environment (e.g., prod, dev) |
π€ Outputsβ
| Name | Description |
|---|---|
sns_topic_arn | The ARN of the created SNS topic |
sns_topic_name | The name of the created SNS topic |
region | The AWS region where the topic was deployed |
π Deployment Readinessβ
- β Compatible with Terraform 1.0+
- β Tested with AWS provider 5.x
- π§ͺ Supports optional KMS encryption and custom display names
π οΈ Example Usageβ
module "sns_topic_basic" {
source = "git::ssh://git@github.com/archiphire/aws-level-1-modules.git//developer-utilities/sns-topic-basic?ref=v1.0.0"
region = "us-east-1"
topic_name = "alerts-topic"
display_name = "Alerts"
kms_key_arn = "arn:aws:kms:us-east-1:123456789012:key/abc123-example"
environment = "prod"
}
terraform init
terraform plan
terraform apply
or
tofu init
tofu plan
tofu apply
π§Ή Cleanup Optionsβ
For testing:
terraform destroy
or
tofu destroy
For production:
Manually delete the SNS topic via the AWS Console or CLI if it is linked to workflows, alerting systems, or critical subscribers.
π‘οΈ Notesβ
This is a Level 1 event and messaging module for provisioning SNS topics. For more advanced pub/sub patterns, extend with filtered subscriptions, cross-account publish permissions, or event-to-pipeline integrations.
π Deployment Package Noticeβ
This module is part of the Level 1 AWS License Tier. To access the full deployment package and source code, subscribe to Archiphire.