在一些项目成功后,我删除了 AWS Lambda 中的功能,CloudWatch 中的日志以及 IAM 角色。同样从我的文档中删除了 my-service
文件夹。
然后我按照 Serverless 中这个教程中的步骤进行操作。
现在当我运行时:
serverless deploy --aws-profile testUser_atWork
testUser_atWork 是我在 AWS 中连接的个人资料之一。
我遇到了以下错误:
Serverless: Packaging service...
Serverless: Excluding development dependencies...
Serverless: Service files not changed. Skipping deployment...
Service Information
service: my-service
stage: dev
region: us-east-1
stack: my-service-dev
api keys:
None
endpoints:
None
functions:
hello: my-service-dev-hello
//serverless.yml
service: my-service
provider:
name: aws
runtime: nodejs6.10
functions:
hello:
handler: handler.hello
以下是我的handler.js代码:
'use strict';
module.exports.hello = (event, context, callback) => {
const response = {
statusCode: 200,
body: JSON.stringify({
message: 'Go Serverless v1.0! Your function executed successfully!',
input: event,
}),
};
callback(null, response);
// Use this code if you don't use the http event with the LAMBDA-PROXY integration
// callback(null, { message: 'Go Serverless v1.0! Your function executed successfully!', event });
};
我不明白为什么它跳过了部署。