AWS CloudFormation
User Guide (Version )

The AWS Documentation website is getting a new look!
Try it now and let us know what you think. Switch to the new look >>

You can return to the original look by selecting English in the language selector above.


The AWS::SNS::Topic resource creates a topic to which notifications can be published.


  • One user can create a maximum of 100,000 topics.

  • This action is idempotent: If the requester already owns a topic with the specified name, that topic's ARN is returned without creating a new topic.


To declare this entity in your AWS CloudFormation template, use the following syntax:


{ "Type" : "AWS::SNS::Topic", "Properties" : { "DisplayName" : String, "KmsMasterKeyId" : String, "Subscription" : [ Subscription, ... ], "TopicName" : String } }


Type: AWS::SNS::Topic Properties: DisplayName: String KmsMasterKeyId: String Subscription: - Subscription TopicName: String



The display name to use for an Amazon SNS topic with SMS subscriptions.

Required: No

Type: String

Update requires: No interruption


The ID of an AWS-managed customer master key (CMK) for Amazon SNS or a custom CMK. For more information, see Key Terms. For more examples, see KeyId in the AWS Key Management Service API Reference.

This property applies only to server-side-encryption.

Required: No

Type: String

Update requires: No interruption


The SNS subscriptions (endpoints) for this topic.

Required: No

Type: List of Subscription

Update requires: No interruption


The name of the topic you want to create. Topic names must include only uppercase and lowercase ASCII letters, numbers, underscores, and hyphens, and must be between 1 and 256 characters long.

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.


If you specify a name, you can't perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name.

Required: No

Type: String

Update requires: Replacement

Return Values


When you pass the logical ID of this resource to the intrinsic Ref function, Ref 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.


The Fn::GetAtt intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.

For more information about using the Fn::GetAtt intrinsic function, see Fn::GetAtt.


Returns the name of an Amazon SNS topic.


An Amazon SNS topic subscribed to which two Amazon SQS queues are subscribed


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


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