Stéphane GRILLON
Stéphane GRILLON

Reputation: 11864

How to use email dynamic list to SNS Topic Subscription in AWS CloudFormation?

My templaste is (for one emeil):

  Parameters:
    MailAlarmsSNS:
       Type: String
       Default: [email protected]

  MessagesInErrorTopic:
    Type: AWS::SNS::Topic
    Properties:
      TopicName: foo
      DisplayName: This topic is used to send an email
      Subscription:
        - Endpoint: !Ref MailAlarmsSNS
          Protocol: email

I want use a dynamic list input (comma separated)?

Upvotes: 3

Views: 1346

Answers (3)

Chandrahas Balleda
Chandrahas Balleda

Reputation: 2822

As stated by @Marcin, you typically need to use a custom resource or macro for that. This repository gives you complete code using the custom resource to add multiple endpoints.

Upvotes: 1

Sachin Shaji
Sachin Shaji

Reputation: 41

You can give multiple endpoints in a single SNS Topic like below:

Cloudformation template for multiple emails

Upvotes: 0

Marcin
Marcin

Reputation: 238051

You can only do that using custom resource or a macro that you would have to develop yourself in the form of lambda functions.

Upvotes: 2

Related Questions