NodeJS AWS在推送到云时放大拒绝的访问

yruzcnhs  于 2023-05-28  发布在  Node.js
关注(0)|答案(3)|浏览(154)

我正在学习this教程,将AWS Amplify集成到iOS中。我添加了GraphQl API后端,但是当我尝试将其推送到云端时,我得到了这个错误:

❯ amplify push
⠙ Fetching updates to backend environment: dev from the cloud.(node:75854) UnhandledPromiseRejectionWarning: AccessDenied: Access Denied
    at Request.extractError (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/aws-sdk/lib/services/s3.js:831:35)
    at Request.callListeners (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/aws-sdk/lib/sequential_executor.js:106:20)
    at Request.emit (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
    at Request.emit (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/aws-sdk/lib/request.js:683:14)
    at Request.transition (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/aws-sdk/lib/request.js:22:10)
    at AcceptorStateMachine.runTo (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/aws-sdk/lib/state_machine.js:14:12)
    at /usr/local/lib/node_modules/@aws-amplify/cli/node_modules/aws-sdk/lib/state_machine.js:26:10
    at Request.<anonymous> (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/aws-sdk/lib/request.js:38:9)
    at Request.<anonymous> (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/aws-sdk/lib/request.js:685:12)
    at Request.callListeners (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/aws-sdk/lib/sequential_executor.js:116:18)
(node:75854) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:75854) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
⠇ Fetching updates to backend environment: dev from the cloud.

然后它挂起,我必须Ctrl-C来摆脱它。我尝试通过运行amplify configure来排除AWS CLI环境的故障,然后按照提示创建新用户。新用户将AdministratorAccess策略附加到其权限,但仍出现相同的AccessDenied错误。

qnyhuwrf

qnyhuwrf1#

我刚刚经历了同样的事情,我注意到我的错误是我在登录到另一个应用程序不存在的帐户时做了amplify configure
对我来说,解决方案是,我登录到正确的帐户,并再次执行amplify configure

h4cxqtbf

h4cxqtbf2#

正如@Dillion所提到的,创建一个新用户(amplify configure)可能是正确的选择,有时候恢复云状态amplify pull --restore也很重要,然后创建您想要做的事情。

ca1c2owp

ca1c2owp3#

没有一个正确的答案,所以我也会回答一个答案。在这里

相关问题