Menu
AWS CloudFormation
User Guide (API Version 2010-05-15)

AWS::SNS::Subscription

The AWS::SNS::Subscription resource subscribes an endpoint to an Amazon Simple Notification Service (Amazon SNS) topic. The owner of the endpoint must confirm the subscription before Amazon SNS creates the subscription.

Syntax

JSON

Copy
{ "Type" : "AWS::SNS::Subscription", "Properties" : { "Endpoint" : String, "Protocol" : String, "TopicArn" : String } }

YAML

Copy
Type: "AWS::SNS::Subscription" Properties: Endpoint: String Protocol: String TopicArn: String

Properties

Endpoint

The endpoint that receives notifications from the Amazon SNS topic. The endpoint value depends on the protocol that you specify. For more information, see the Subscribe Endpoint parameter in the Amazon Simple Notification Service API Reference.

Required: No

Type: String

Update requires: Replacement

Protocol

The subscription's protocol. For more information, see the Subscribe Protocol parameter in the Amazon Simple Notification Service API Reference.

Required: Yes

Type: String

Update requires: Replacement

TopicArn

The Amazon Resource Name (ARN) of the topic to subscribe to.

Required: Yes

Type: String

Update requires: Replacement

Example

The following

JSON

Copy
"MySubscription" : { "Type" : "AWS::SNS::Subscription", "Properties" : { "Endpoint" : "test@email.com", "Protocol" : "email", "TopicArn" : {"Ref" : "MySNSTopic"} } }

YAML

Copy
MySubscription: Type: AWS::SNS::Subscription Properties: Endpoint: test@email.com Protocol: email TopicArn: !Ref 'MySNSTopic'

On this page: