无服务器框架 - 在 "self" 源中未找到值
Serverless Framework - Value not found at "self" source
我有以下 serverless.yml 文件:
org: bizrob
app: flexipod-2-queue
service: flexipod-2-queue
frameworkVersion: "^2.72.2"
custom:
region: eu-west-1
provider:
name: aws
runtime: nodejs14.x
plugins:
- serverless-prune-plugin
- serverless-offline
- serverless-webpack
- serverless-plugin-resource-tagging
- serverless-step-functions
functions:
cronHandler:
handler: flexipod-2-queue/flexipodJob.dataFeedsJob
events:
# Invoke Lambda function every 2nd minute from Mon-Fri
- schedule: cron(0/8 * ? * MON *)
environment:
REGION: ${self:custom.region}
API_VERSION_S3: "2006-03-01"
API_VERSION_SQS: "2012-11-05"
SQS_QUEUE_URL: !Ref "MyQueue"
resources:
Resources:
MyQueue:
Type: "AWS::SQS::Queue"
Properties:
QueueName: "flexipod"
当我 运行 无服务器部署时,出现以下错误:
Cannot resolve variable at "functions.cronHandler.environment.REGION":
Value not found at "self" source
有人看到我做错了什么吗?
感谢@eli6 提供有关无服务器打印的提示。我不知道问题的根本原因,但在重新启动后 vscode 无服务器打印和无服务器部署然后工作了
我有以下 serverless.yml 文件:
org: bizrob
app: flexipod-2-queue
service: flexipod-2-queue
frameworkVersion: "^2.72.2"
custom:
region: eu-west-1
provider:
name: aws
runtime: nodejs14.x
plugins:
- serverless-prune-plugin
- serverless-offline
- serverless-webpack
- serverless-plugin-resource-tagging
- serverless-step-functions
functions:
cronHandler:
handler: flexipod-2-queue/flexipodJob.dataFeedsJob
events:
# Invoke Lambda function every 2nd minute from Mon-Fri
- schedule: cron(0/8 * ? * MON *)
environment:
REGION: ${self:custom.region}
API_VERSION_S3: "2006-03-01"
API_VERSION_SQS: "2012-11-05"
SQS_QUEUE_URL: !Ref "MyQueue"
resources:
Resources:
MyQueue:
Type: "AWS::SQS::Queue"
Properties:
QueueName: "flexipod"
当我 运行 无服务器部署时,出现以下错误:
Cannot resolve variable at "functions.cronHandler.environment.REGION": Value not found at "self" source
有人看到我做错了什么吗?
感谢@eli6 提供有关无服务器打印的提示。我不知道问题的根本原因,但在重新启动后 vscode 无服务器打印和无服务器部署然后工作了