简体   繁体   English

AWS SES Configset - 无法使用 AWS 云形成堆栈创建到 SNS 的事件目标

[英]AWS SES Configset - Can't create an event destination to SNS using AWS cloud formation stack

I can't seem to be able to create a new AWS SES configset using AWS Cloud Formation stack.我似乎无法使用 AWS Cloud Formation 堆栈创建新的 AWS SES 配置集。 The error says 'YAML not well-formed'错误显示“YAML 格式不正确”

Below is my json template for the CF stack:下面是我的 json CF 堆栈模板:

"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......上面的 json 对我来说看起来不错但是......

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.现在,尽管我面临另一个问题,即 SNSDestination 是 EventDestination。 It says Unsupported property for EventDestination, even though the AWS documentation says that its a valid property:它说 EventDestination 不受支持的属性,即使 AWS 文档说它是一个有效的属性:

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.顺便说一句,我有最新的 AWS cli。

i think SNSDestination is not supported now.我认为现在不支持SNSDestination it probably is by default there when you set the configset默认情况下,当您设置配置集时,它可能在那里

Cloudformation is case-sensitive, so it should be SnsDestination , not SNSDestination Cloudformation 区分大小写,因此它应该是SnsDestination ,而不是SNSDestination

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM