Amazon cloudformation cloudformation模板-验证错误
我需要使用云形成模板将sns主题指定为目标 JobFailedAlert是sns主题的名称 我有这个模板rule.json,我得到了错误 错误:Amazon cloudformation cloudformation模板-验证错误,amazon-cloudformation,amazon-sns,Amazon Cloudformation,Amazon Sns,我需要使用云形成模板将sns主题指定为目标 JobFailedAlert是sns主题的名称 我有这个模板rule.json,我得到了错误 错误: Template validation error: Template error: instance of Fn::GetAtt references undefined resource SNSTopic 模板: { "Resources": { "Rule": { "Type" : "AWS::Events::Rule",
Template validation error: Template error: instance of Fn::GetAtt references undefined resource SNSTopic
模板:
{
"Resources": {
"Rule": {
"Type" : "AWS::Events::Rule",
"Properties" : {
"Description" : "create a sns alert when a batch job changes state to failed",
"EventPattern" : {
"detail-type": [
"Batch Job State Change"
],
"source": [
"aws.batch"
],
"detail": {
"jobQueue": [
"arn:aws:batch:us-east-1:************:job-queue/testbatchjobqueue"
],
"status": [
"FAILED"
]
}
},
"Name" : "alertonfailedbatchjobs2",
"State" : "Enabled",
"Targets": [
{
"Arn": { "Ref": "SNS Topic" },
"Id": "JobFailedAlert"
}
}
}
}
}
可能规则是在SNS主题之前创建的。尝试确保首先使用DependsOn创建SNS主题,例如:
"Rule": {
DependsOn: TheSNSTopic
...
}
请显示模板中定义SNS主题的部分。