Trying to set up a SNS email subscription and I se...
# general
Trying to set up a SNS email subscription and I see this in the docs for `TopicSubscriptionArgs`:
Copy code
     * The protocol to use. The possible values for this are: `sqs`, `sms`, `lambda`, `application`. (`http` or `https` are partially supported, see below) (`email` is option but unsupported, see below).
    readonly protocol: pulumi.Input<string>;
What does "(
is option but unsupported, see below)" mean? How am I supposed to create an email subscription?
Not as far as I’m aware right now
It’s been a limitation of Terraform forever
So how do people set up CloudWatch alarms with email? Do users typically do this manually?
My guess is manually, I’ve never actually tried it though
Seems like the workaround is to use a CF stack to create the subscription: Nasty but will probably work.
Ugh, that sucks. I wonder if we can do better here. It’s conceivable that there are other workflows since that was done in Terraform (similar to ACM etc)
It may be possible to wrap a CF template, similar to what the awsx.Cluster.createAutoScalingGroup does.
Will try something like this:
Copy code
function snsEmailSubscription(topicArn: string, email: string) {
    return new aws.cloudformation.Stack("alert-email-subscribe", {
        templateBody: JSON.stringify({
            "AWSTemplateFormatVersion": "2010-09-09",
            "Resources": {
                "EmailSNSTopic": {
                    "Type": "AWS::SNS::Subscription",
                    "Properties": {
                        "TopicArn": topicArn,
                        "Protocol": "email",
                        "Endpoint": email
        capabilities: ["CAPABILITY_NAMED_IAM"]
This is probably the kind of thing we should consider adding to
itself, too (cc @white-balloon-205)
FWIW, the above snippet works nicely.