简体   繁体   English

如何解决 deploy serverless error: The provided access key is not authorized for this operation?

[英]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.

相关问题 尝试使用 REST API 公开对象时出现“访问被拒绝。提供的范围未被授权”错误 - "Access Denied. Provided scope(s) are not authorized" error when trying to make objects public using the REST API 如何解决 Fargate 上 ECS 中任务执行的“ResourceInitializationError”错误? - How do I solve "ResourceInitializationError" error for Task execution in ECS on Fargate? 调用Scan操作时如何解决(AccessDeniedException):User: arn:aws:sts... is not authorized to perform: dynamodb:Scan on resource.."? - How to solve (AccessDeniedException) when calling the Scan operation: User: arn:aws:sts... is not authorized to perform: dynamodb:Scan on resource.."? 我应该怎么做才能使用 boto3 修复“您提供的 AWS 访问密钥 ID 在我们的记录中不存在” - What should I do to fix "The AWS Access Key Id you provided does not exist in our records" using boto3 如何使用无服务器 cli 部署多个功能? - How to deploy multiple functions using serverless cli? Boto3 错误:您提供的 AWS 访问密钥 ID 在我们的记录中不存在 - Boto3 error: The AWS Access Key Id you provided does not exist in our records 如何解决无服务器框架 3 中的授权问题? - How to solve authorizer issue in Serverless framework 3? 在 AWS 上使用带有 api 密钥的 2 个阶段时,如何修复无服务器错误“指定的 API 密钥标识符无效”? - How to fix Serverless error "Invalid API Key identifier specified" when using 2 stages with api keys on AWS? 如何将使用 sharp 库的 macOS 无服务器框架应用程序部署到 AWS? - How can I deploy a Serverless Framework application the macOS that uses the sharp library to AWS? 尝试导入时,我收到不知道如何解决的错误代码 - When tryin to do a import, I get error codes which I do not know how to solve
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM