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

Viewed 308

My templaste is (for one emeil):

  Parameters:
    MailAlarmsSNS:
       Type: String
       Default: mymail@company.com

  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)?

2 Answers

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

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

Cloudformation template for multiple emails

Related