Use this data source to get the ARN of a topic in AWS Simple Notification Service (SNS). By using this data source, you can reference SNS topics without having to hard code the ARNs as input.
data "aws_sns_topic" "example" {
name = "an_example_topic"
}
name
- (Required) Friendly name of the topic to match.This data source exports the following attributes in addition to the arguments above:
arn
- ARN of the found topic, suitable for referencing in other resources that support SNS topics.id
- ARN of the found topic, suitable for referencing in other resources that support SNS topics.