Serverless Debug日记

项目场景:

在跑一个sklearn部署在serverless的样例遇到了如下问题


问题描述:

serverless.yml配置文件修改为:
functions:
  predict-price:
    handler: handler.predict
    memorySize: 512
    timeout: 30
    events:
      - http:
          path: get-price
          method: get
          request:
            parameters:
              queryStrings:
                medInc: true
                houseAge: true
                aveRooms: true
                aveBedrms: true
                population: true
                aveOccup: true
                latitute: true
                longtitute: true

出现报错

Serverless: Configuration warning at 'functions['predict-price'].events[0].http.request.parameters': unrecognized property 'queryStrings'
Serverless:  
Serverless: Learn more about configuration validation here: http://slss.io/configuration-validation
Serverless:  
Serverless: Deprecation warning: Starting with next major version, API Gateway naming will be changed from "{stage}-{service}" to "{service}-{stage}".
            Set "provider.apiGateway.shouldStartNameWithService" to "true" to adapt to the new behavior now.
            More Info: https://www.serverless.com/framework/docs/deprecations/#AWS_API_GATEWAY_NAME_STARTING_WITH_SERVICE
Serverless: Setting up AWS...

 Serverless Error ---------------------------------------
 
  The security token included in the request is invalid.
 
  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com

解决方案:

将region改为us-east-1

版权声明:本文为kkkokra原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。