推送到云时 AWS Amplify 访问被拒绝
AWS Amplify Access Denied when Pushing to Cloud
我正在学习 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 错误。
我刚刚遇到了同样的情况,我注意到我的错误是 amplify configure
登录到另一个不存在该应用程序的帐户。
我的解决方案是,我登录到正确的帐户并再次执行 amplify configure
。
如@Dillion 所述,创建新用户 (amplify configure
) 可能是正确的选择,有时恢复云状态很重要 amplify pull --restore
,然后创建你打算做什么。
我正在学习 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 错误。
我刚刚遇到了同样的情况,我注意到我的错误是 amplify configure
登录到另一个不存在该应用程序的帐户。
我的解决方案是,我登录到正确的帐户并再次执行 amplify configure
。
如@Dillion 所述,创建新用户 (amplify configure
) 可能是正确的选择,有时恢复云状态很重要 amplify pull --restore
,然后创建你打算做什么。