[英]How do I solve the deploy serverless error : The provided access key is not authorized for this operation?
I want to deploy a Spring Boot Rest API The serverless.yml look like this:我想部署一个 Spring Boot Rest API serverless.yml 看起来像这样:
org: steinko
app: helloworld
service: backend
provider:
name: aws
runtime: java8
iam:
role:
statements:
- Effect: "Allow"
Action:
- "*"
Resource: "arn:aws:*"
package:
artifact: build/libs/backend.jar
functions:
helloworld:
handler: org.steinko.helloworld.EntryPoint
events:
- http:
path: /helloworld
method: get
When I run: serverless deploy当我运行时:无服务器部署
I get the error:我收到错误:
steinko@Steins-MacBook-Pro backend % serverless deploy steinko@Steins-MacBook-Pro 后端 % 无服务器部署
Using local credentials.使用本地凭据。 Add provider credentials via dashboard: https://app.serverless.com/steinko/apps/helloworld/backend/dev/us-east-1/providers
通过仪表板添加提供商凭据: https://app.serverless.com/steinko/apps/helloworld/backend/dev/us-east-1/providers
Deploying backend to stage dev (us-east-1)
✖ Stack backend-dev failed to deploy (0s)
Environment: darwin, node 14.17.3, framework 3.7.5, plugin 6.1.5, SDK 4.3.2
Credentials: Local, environment variables
Docs: docs.serverless.com
Support: forum.serverless.com
Bugs: github.com/serverless/serverless/issues
Error:
Error: The provided access key is not authorized for this operation. - Please contact support and provide this identifier to reference this issue - ZXL92JHX1RX6
at Object.request (/usr/local/lib/node_modules/serverless/node_modules/@serverless/platform-client/src/utils.js:64:19)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async module.exports (/usr/local/lib/node_modules/serverless/node_modules/@serverless/dashboard-plugin/lib/app-uids.js:7:15)
at async ServerlessEnterprisePlugin.<anonymous> (/usr/local/lib/node_modules/serverless/node_modules/@serverless/dashboard-plugin/lib/plugin.js:252:13)
at async PluginManager.runHooks (/usr/local/lib/node_modules/serverless/lib/classes/plugin-manager.js:530:9)
at async PluginManager.invoke (/usr/local/lib/node_modules/serverless/lib/classes/plugin-manager.js:563:9)
at async PluginManager.spawn (/usr/local/lib/node_modules/serverless/lib/classes/plugin-manager.js:585:5)
at async before:deploy:deploy (/usr/local/lib/node_modules/serverless/lib/plugins/deploy.js:40:11)
at async PluginManager.runHooks (/usr/local/lib/node_modules/serverless/lib/classes/plugin-manager.js:530:9)
at async PluginManager.invoke (/usr/local/lib/node_modules/serverless/lib/classes/plugin-manager.js:563:9)
at async PluginManager.run (/usr/local/lib/node_modules/serverless/lib/classes/plugin-manager.js:604:7)
at async Serverless.run (/usr/local/lib/node_modules/serverless/lib/serverless.js:174:5)
at async /usr/local/lib/node_modules/serverless/scripts/serverless.js:687:9
How do I fix this error?我该如何解决这个错误?
Remove app and org information from your serverless.yml从 serverless.yml 中删除应用和组织信息
Encountered same problem after switching serverless accounts.切换无服务器帐户后遇到同样的问题。
For me deleting ~/.serverless ~/.serverlessrc and running serverless login
again solved the issue.对我来说,删除 ~/.serverless ~/.serverlessrc 并再次运行
serverless login
解决了这个问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.