Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
Merge pull request #24 from comtravo/chore/sns
Browse files Browse the repository at this point in the history
Move SNS topic to monorepo
  • Loading branch information
Puneeth-n committed Jan 26, 2022
2 parents a2b0fd5 + e9cafbd commit 1152070
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
22 changes: 22 additions & 0 deletions sns/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
## Requirements

No requirements.

## Providers

| Name | Version |
|------|---------|
| aws | n/a |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| name | SNS topic name | `string` | n/a | yes |

## Outputs

| Name | Description |
|------|-------------|
| arn | SNS topic ARN |
| aws\_sns\_topic | SNS topic attributes |
22 changes: 22 additions & 0 deletions sns/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
variable "name" {
type = string
description = "SNS topic name"
}

data "aws_region" "current" {}

data "aws_caller_identity" "current" {}

resource "aws_sns_topic" "this" {
name = var.name
}

output "arn" {
description = "SNS topic ARN"
value = "arn:aws:sns:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:${var.name}" # Generated so that plans succeed when this output is used in for example count or for_each
}

output "aws_sns_topic" {
value = aws_sns_topic.this
description = "SNS topic attributes"
}

0 comments on commit 1152070

Please sign in to comment.