'InvalidClientTokenId' 初始化 AWS Amplify 时出错
'InvalidClientTokenId' error while initialising AWS Amplify
我正在尝试通过
初始化放大
$ amplify init
在一个 Android 项目中。不知何故,每次设置失败并显示以下堆栈跟踪:
⠹ Initializing project in the cloud...An error occurred when creating
the CloudFormation stack ✖ Root stack creation failed init failed {
InvalidClientTokenId: The security token included in the request is
invalid.
at Request.extractError (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/node_modules/aws-sdk/lib/protocol/query.js:47:29)
at Request.callListeners (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/node_modules/aws-sdk/lib/sequential_executor.js:109:20)
at Request.emit (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/node_modules/aws-sdk/lib/sequential_executor.js:81:10)
at Request.emit (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/node_modules/aws-sdk/lib/request.js:683:14)
at Request.transition (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/node_modules/aws-sdk/lib/request.js:22:10)
at AcceptorStateMachine.runTo (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/node_modules/aws-sdk/lib/state_machine.js:14:12)
at /usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/node_modules/aws-sdk/lib/state_machine.js:26:10
at Request. (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/node_modules/aws-sdk/lib/request.js:38:9)
at Request. (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/node_modules/aws-sdk/lib/request.js:685:12)
at Request.callListeners (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/node_modules/aws-sdk/lib/sequential_executor.js:119:18)
message: 'The security token included in the request is invalid.',
code: 'InvalidClientTokenId', time: 2018-10-30T12:24:49.192Z,
requestId: 'cb4cc85a-dc3e-11e8-ad2e-1dd03551193d', statusCode: 403,
retryable: false, retryDelay: 71.00058281764416 } An error occurred
when creating the CloudFormation stack
我尝试删除 ~/.aws/ 文件夹中的凭据和配置文件,同时删除 AWS IAM 用户和 运行
$ aws configure
再次执行 init 命令,但无济于事。不知道怎么回事。
我用一种奇怪的方式解决了这个问题。可能对别人有帮助。事实证明,我能够在重新安装 amplify cli 后摆脱错误:
$ sudo npm install -g @aws-amplify/cli
我的问题是我需要完成我的 AWS 账户设置并添加信用卡信息,然后在 AWS 网站上完成设置过程。
我正在尝试通过
初始化放大$ amplify init
在一个 Android 项目中。不知何故,每次设置失败并显示以下堆栈跟踪:
⠹ Initializing project in the cloud...An error occurred when creating the CloudFormation stack ✖ Root stack creation failed init failed { InvalidClientTokenId: The security token included in the request is invalid. at Request.extractError (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/node_modules/aws-sdk/lib/protocol/query.js:47:29) at Request.callListeners (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/node_modules/aws-sdk/lib/sequential_executor.js:109:20) at Request.emit (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/node_modules/aws-sdk/lib/sequential_executor.js:81:10) at Request.emit (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/node_modules/aws-sdk/lib/request.js:683:14) at Request.transition (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/node_modules/aws-sdk/lib/request.js:22:10) at AcceptorStateMachine.runTo (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/node_modules/aws-sdk/lib/state_machine.js:14:12) at /usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/node_modules/aws-sdk/lib/state_machine.js:26:10 at Request. (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/node_modules/aws-sdk/lib/request.js:38:9) at Request. (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/node_modules/aws-sdk/lib/request.js:685:12) at Request.callListeners (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/node_modules/aws-sdk/lib/sequential_executor.js:119:18) message: 'The security token included in the request is invalid.',
code: 'InvalidClientTokenId', time: 2018-10-30T12:24:49.192Z,
requestId: 'cb4cc85a-dc3e-11e8-ad2e-1dd03551193d', statusCode: 403, retryable: false, retryDelay: 71.00058281764416 } An error occurred when creating the CloudFormation stack
我尝试删除 ~/.aws/ 文件夹中的凭据和配置文件,同时删除 AWS IAM 用户和 运行
$ aws configure
再次执行 init 命令,但无济于事。不知道怎么回事。
我用一种奇怪的方式解决了这个问题。可能对别人有帮助。事实证明,我能够在重新安装 amplify cli 后摆脱错误:
$ sudo npm install -g @aws-amplify/cli
我的问题是我需要完成我的 AWS 账户设置并添加信用卡信息,然后在 AWS 网站上完成设置过程。