首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >VS 2019亚马逊网络服务Serverless.Template解析错误

VS 2019亚马逊网络服务Serverless.Template解析错误
EN

Stack Overflow用户
提问于 2021-01-05 05:35:35
回答 1查看 50关注 0票数 0

下午,我试图使用亚马逊网络服务工具包和servless.template创建一个按计划触发的lambda,并将数据插入到sqs中。除了"Events“这一行之外,一切都很好。我收到一个错误,上面写着"Parse error on line 24“。我已经检查,再检查,并验证了摆动括号的位置,但没有通过。根据aws文档,我应该能够在lambda定义中建立事件。

任何帮助都是非常感谢的!这是我的代码。参数化,因为应用程序将通过azure在多个环境中部署。

代码语言:javascript
复制
{
"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"
        }
    }

    }
  }
}
EN

回答 1

Stack Overflow用户

发布于 2021-01-05 05:48:11

看起来在第23行,}之后缺少一个拼写错误的,。在第26行上也缺少,

通常,使用some online tool验证您的JSON非常有用,它可以帮助您快速了解错误。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65570155

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档