3

I can't seem to be able to create a new AWS SES configset using AWS Cloud Formation stack. The error says 'YAML not well-formed'

Below is my json template for the CF stack:

"Resources" : {
"ConfigSet": {
    "Type": "AWS::SES::ConfigurationSet",
    "Properties": {
        "Name": "CS_EMAIL_TRACKING"
    }
},
"CWEventDestination": {
    "Type": "AWS::SES::ConfigurationSetEventDestination",
    "Properties": {
        "ConfigurationSetName": "CS_EMAIL_TRACKING",
        "EventDestination": {
            "Name": "CS_EMAIL_TRACKING_CW_DESTINATION",
            "Enabled": true,
            "MatchingEventTypes": ["bounce", "complaint", "delivery", "open", "reject", "renderingFailure", "send"],
            "CloudWatchDestination": {
                "DimensionConfigurations": [{
                    "DimensionName": "AGS",
                    "DimensionValueSource": "messageTag",
                    "DefaultDimensionValue": "MY_AGS"
                }, {
                    "DimensionName": "Component",
                    "DimensionValueSource": "messageTag",
                    "DefaultDimensionValue": "Mail"
                }, {
                    "DimensionName": "ses:caller-identity",
                    "DimensionValueSource": "messageTag",
                    "DefaultDimensionValue": "shouldbeautoset"
                }]
            }
        }
    }
},
"SNSEventDestination": {
    "Type": "AWS::SES::ConfigurationSetEventDestination",
    "Properties": {
        "ConfigurationSetName": "CS_EMAIL_TRACKING",
        "EventDestination": {
            "Name": "CS_EMAIL_TRACKING_SNS_DESTINATION",
            "Enabled": true,
            "MatchingEventTypes": ["bounce", "complaint", "delivery", "reject", "send"],
            "SNSDestination": {
                "TopicARN": "arn:aws:sns:us-east-1:99999999:SES-STATUS_TRACKING_TOPIC"
            }
        }
    }
}

}

The above json looks good to me but......

Can anybody help? Am I missing something?

Thanks!

Edit: I got the stack working with parameters. Now, though I face another problem with SNSDestination being the EventDestination. It says Unsupported property for EventDestination, even though the AWS documentation says that its a valid property:

Below is my final code:

{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "AWS SES ConfigurationSet ${CRED_AGS} Template",
"Parameters": {
    "ConfigSetName": {
        "Type" : "String",
        "Default" : "${CONFIGSET_NAME}"
    },
    "EventCWDestinationName" : {
        "Type" : "String",
        "Default" : "${CW_DESTINATION_NAME}"
    },
    "EventSNSDestinationName" : {
        "Type" : "String",
        "Default" : "${SNS_DESTINATION_NAME}"
    },
    "EventTypeBounce" : {
        "Type" : "String",
        "Default" : "bounce"
    },
    "EventTypeComplaint" : {
        "Type" : "String",
        "Default" : "complaint"
    },
    "EventTypeDelivery" : {
        "Type" : "String",
        "Default" : "delivery"
    },
    "EventTypeOpen" : {
        "Type" : "String",
        "Default" : "open"
    },
    "EventTypeReject" : {
        "Type" : "String",
        "Default" : "reject"
    },
    "EventTypeRenderingFailure" : {
        "Type" : "String",
        "Default" : "renderingFailure"
    },
    "EventTypeSend" : {
        "Type" : "String",
        "Default" : "send"
    },
    "DimensionValueSourceMsgTag" : {
        "Type" : "String",
        "Default" : "messageTag"
    },
    "DimensionNameAGS" : {
        "Type" : "String",
        "Default" : "AGS"
    },
    "DefaultDimensionValueAGS" : {
        "Type" : "String",
        "Default" : "${CRED_AGS}"
    },
    "DimensionNameComponent" : {
        "Type" : "String",
        "Default" : "Component"
    },
    "DefaultDimensionValueComponent" : {
        "Type" : "String",
        "Default" : "Mail"
    },
    "DimensionNameIdentity" : {
        "Type" : "String",
        "Default" : "ses:caller-identity"
    },
    "DefaultDimensionValueIdentity" : {
        "Type" : "String",
        "Default" : "shouldbeautoset"
    }
},
"Resources": {
    "ConfigSet" : {
        "Type" : "AWS::SES::ConfigurationSet",
        "Properties" : {
            "Name" : {
                "Ref" : "ConfigSetName"
            }
        }
    },
    "CWEventDestination" : {
        "Type" : "AWS::SES::ConfigurationSetEventDestination",
        "Properties" : {
            "ConfigurationSetName" : {
                "Ref": "ConfigSetName"
            },
            "EventDestination" : {
                "Name" : {
                    "Ref" : "EventCWDestinationName"
                },
                "Enabled" : true,
                "MatchingEventTypes" : [
                    {
                        "Ref" : "EventTypeBounce"
                    },
                    {
                        "Ref" : "EventTypeComplaint"
                    },
                    {
                        "Ref" : "EventTypeDelivery"
                    },
                    {
                        "Ref" : "EventTypeOpen"
                    },
                    {
                        "Ref" : "EventTypeReject"
                    },
                    {
                        "Ref" : "EventTypeRenderingFailure"
                    },
                    {
                        "Ref" : "EventTypeSend"
                    }
                ],
                "CloudWatchDestination" : {
                    "DimensionConfigurations" : [
                        {
                            "DimensionName" : {
                                "Ref" : "DimensionNameAGS"
                            },
                            "DimensionValueSource" : {
                                "Ref" : "DimensionValueSourceMsgTag"
                            },
                            "DefaultDimensionValue" : {
                                "Ref": "DefaultDimensionValueAGS"
                            }
                        },
                        {
                            "DimensionName" : {
                                "Ref" : "DimensionNameComponent"
                            },
                            "DimensionValueSource" : {
                                "Ref" : "DimensionValueSourceMsgTag"
                            },
                            "DefaultDimensionValue" : {
                                "Ref" : "DefaultDimensionValueComponent"
                            }
                        },
                        {
                            "DimensionName" : {
                                "Ref" : "DimensionNameIdentity"
                            },
                            "DimensionValueSource" : {
                                "Ref" : "DimensionValueSourceMsgTag"
                            },
                            "DefaultDimensionValue" : {
                                "Ref" : "DefaultDimensionValueIdentity"
                            }
                        }
                    ]
                }
            }
        }
    },
    "SNSEventDestination" : {
        "Type" : "AWS::SES::ConfigurationSetEventDestination",
        "Properties" : {
            "ConfigurationSetName" : {
                "Ref": "ConfigSetName"
            },
            "EventDestination" : {
                "Name" : {
                    "Ref" : "EventSNSDestinationName"
                },
                "Enabled" : true,
                "MatchingEventTypes" : [
                    {
                        "Ref" : "EventTypeBounce"
                    },
                    {
                        "Ref" : "EventTypeComplaint"
                    },
                    {
                        "Ref" : "EventTypeDelivery"
                    },
                    {
                        "Ref" : "EventTypeReject"
                    },
                    {
                        "Ref" : "EventTypeSend"
                    }
                ],
                "SNSDestination" : {
                    "TopicARN" : "${SNS_DELIVERY_TOPIC}"
                } 
            }
        }
    }
}

}

Can someone pls help? BTW, I have the lastest AWS cli with me.

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
Anshuman
  • 577
  • 1
  • 8
  • 23
  • In which region are you creating the stack? Make sure it is in a region that has SES. – John Rotenstein Aug 06 '18 at 00:11
  • All of the resourcese are in us-east-1 – Anshuman Aug 06 '18 at 01:01
  • Do you have any links to documentation that says `SNSDestination` is supported in CloudFormation? It is not listed in [AWS::SES::ConfigurationSetEventDestination - AWS CloudFormation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ses-configurationseteventdestination.html#cfn-ses-configurationseteventdestination-eventdestination). – John Rotenstein Aug 06 '18 at 01:14
  • 2
    Yes @JohnRotenstein, I was able to find that out. Finally, I was able to create the SNS destination by AWS CLI command. AWS says they are working on it and will be coming out with CF provisioning for SNS destination soon. Thanks for your help! – Anshuman Aug 07 '18 at 02:31
  • 3
    I am pretty sure SNS destination is still unsupported in Cloud Formation :( – Yani Feb 25 '21 at 09:24

2 Answers2

0

i think SNSDestination is not supported now. it probably is by default there when you set the configset

mdrijwan
  • 41
  • 1
  • 8
0

Cloudformation is case-sensitive, so it should be SnsDestination, not SNSDestination

mykeels
  • 590
  • 5
  • 9