下午,我试图使用亚马逊网络服务工具包和servless.template创建一个按计划触发的lambda,并将数据插入到sqs中。除了"Events“这一行之外,一切都很好。我收到一个错误,上面写着"Parse error on line 24“。我已经检查,再检查,并验证了摆动括号的位置,但没有通过。根据aws文档,我应该能够在lambda定义中建立事件。
任何帮助都是非常感谢的!这是我的代码。参数化,因为应用程序将通过azure在多个环境中部署。
{
"AWSTemplateFormatVersion": "2010-09-09",
"Transform": "AWS::Serverless-2016-10-31",
"Description": "An AWS Serverless Application.",
"Parameters":{
"AwsRole" : { "Description" : "Role for lambda expression", "Type": "String"},
"SecurityGroup" : { "Description" : "List of secuirty group ids, comma delimited", "Type" : "List<String>" },
"SubNets" : { "Description" : "List of subnet ids, comma delimited", "Type" : "List<String>" },
"Schedule" : {"Description" : "Cron schedule", "Type" : "String"}
},
"Resources": {
"PopulateQueue": {
"Type": "AWS::Serverless::Function",
"Properties": {
"Handler": "SendToQueue::SendToQueue.PopulateSqs::RunPopulate",
"Runtime": "dotnetcore3.1",
"CodeUri": "",
"MemorySize": 256,
"Role" : {"Ref" : "AwsRole"},
"VpcConfig" : {
"SecurityGroupIds" : { "Ref" : "SecurityGroup" } ,
"SubnetIds" : { "Ref" : "SubNets"}
}
error here--->"Events": {
"Trigger":{
"Type": "Schedule"
"Properties" : {
"Schedule" : { "Ref" : "Schedule" },
"Name" : "PopulateSqsSchedule",
"Description" : "Schedule for sending items to sqs",
"Enabled" : false
}
}
}
}
},
"SendQueue": {
"Type": "AWS::SQS::Queue",
"Properties": {
"ContentBasedDeduplication": true,
"MessageRetentionPeriod": 1200,
"QueueName": "SendQueue"
}
}
}
}
}发布于 2021-01-05 05:48:11
看起来在第23行,}之后缺少一个拼写错误的,。在第26行上也缺少,。
通常,使用some online tool验证您的JSON非常有用,它可以帮助您快速了解错误。
https://stackoverflow.com/questions/65570155
复制相似问题