AWS CloudFormation
User Guide (API Version 2010-05-15)
« PreviousNext »
View the PDF for this guide.Go to the AWS Discussion Forum for this product.Go to the Kindle Store to download this guide in Kindle format.Did this page help you?  Yes | No |  Tell us about it...

AWS::SNS::Topic

The AWS::SNS::Topic type creates an Amazon SNS topic.

Syntax

{
   "DisplayName" : String,
   "Subscription" : [ SNS Subscription, ... ],
   "TopicName" : String
}     

Properties

Important

After you create an Amazon SNS topic, you cannot update its properties by using AWS CloudFormation. You can modify an Amazon SNS topic by using the AWS Management Console.

DisplayName

A developer-defined string that can be used to identify this SNS topic.

Required: No

Type: String

Update requires: Updates are not supported

Subscription

The SNS subscriptions (endpoints) for this topic.

Required: No

Type: List of SNS Subscriptions

Update requires: Updates are not supported

TopicName

A name for the topic. If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the topic name. For more information, see Name Type.

Required: No

Type: Name Type

Update requires: Updates are not supported

Return Values

Ref

For the AWS::SNS::Topic resource, the Ref intrinsic function returns the topic ARN, for example: arn:aws:sns:us-east-1:123456789012:mystack-mytopic-NZJ5JSMVGFIE.

For more information about using the Ref function, see Ref.

Fn::GetAtt

Fn::GetAtt returns a value for a specified attribute of this type. This section lists the available attributes and corresponding return values.

TopicName

Returns the name for an Amazon SNS topic.

For more information about using Fn:GetAtt, see Fn::GetAtt.

Examples

An example of an SNS topic subscribed to by two SQS queues:

"MySNSTopic" : {
   "Type" : "AWS::SNS::Topic",
   "Properties" : {
      "Subscription" : [
         { "Endpoint" : { "Fn::GetAtt" : [ "MyQueue1", "Arn" ] }, "Protocol" : "sqs" },
         { "Endpoint" : { "Fn::GetAtt" : [ "MyQueue2", "Arn" ] }, "Protocol" : "sqs" }
      ],
      "TopicName" : "SampleTopic"
   }
}

See Also