【发布时间】:2016-12-26 17:49:34
【问题描述】:
我的 CloudFormation 模板上有以下资源,用于创建运行 Lambda 函数的规则,来自 AWS 文档:
"ScheduledRule": {
"Type": "AWS::Events::Rule",
"Properties": {
"Description": "ScheduledRule",
"ScheduleExpression": "rate(5 minutes)",
"State": "ENABLED",
"Targets": [{
"Arn": { "Fn::GetAtt": ["myLambda", "Arn"] },
"Id": "TargetFunctionV1"
}]
}
}
我想指定输入:
{
"Arn" : String,
"Id" : String,
"Input" : String,
"InputPath" : String
}
并且 Input 是传递给目标的 JSON 格式的文本字符串。此值会覆盖匹配的事件。
我希望我的 JSON 格式文本是:
{
"mykey1": "Some Value"
}
我不知道如何在输入中指定它,当我输入时:
"ScheduledRule": {
"Type": "AWS::Events::Rule",
"Properties": {
"Description": "ScheduledRule",
"ScheduleExpression": "rate(5 minutes)",
"State": "ENABLED",
"Targets": [{
"Arn": { "Fn::GetAtt": ["myLambda", "Arn"] },
"Id": "TargetFunctionV1",
"Input": { "mykey1": "Some Value" }
}]
}
}
我会得到错误:
Value of property Input must be of type String
我应该如何正确指定?
【问题讨论】:
标签: json amazon-cloudformation