cloudformation 模板- 验证错误
cloudformation template- validation error
我需要使用云形成模板将 sns 主题指定为目标。
JobFailedAlert 是 sns 主题的名称。
我有这个模板 rule.json 但我收到错误消息
错误:
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 主题指定为目标。
JobFailedAlert 是 sns 主题的名称。
我有这个模板 rule.json 但我收到错误消息
错误:
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
...
}