Note, August 2022: AWS CloudFormation now supports the subscription of multiple resources through the AWS::SNS::Topic object and its Subscription attribute.
This pattern describes how to subscribe multiple email addresses to receive notifications from an Amazon Simple Notification Service (Amazon SNS) topic. It uses an AWS Lambda function as a custom resource in an AWS CloudFormation template. The Lambda function is associated with an input parameter that specifies the email endpoints for the SNS topic.
Currently, you can use the AWS CloudFormation template objects AWS::SNS::Topic and AWS::SNS::Subscription to subscribe single endpoints to SNS topics. To subscribe multiple endpoints, you have to invoke the object multiple times. By using the Lambda function as a custom resource, you can subscribe multiple endpoints through an input parameter. You can use this Lambda function as a custom resource in any AWS CloudFormation template.