在OSX 10.11 Node v4.4.5 NPM 3.9.5上设置Serverless 0.5.6后,我运行serverless project install serverless-graphql-blog
并为新配置文件提供IAM凭据,我得到:
Serverless:通过Cloudformation将资源部署到区域"us-west-2"中的stage"dev"(约3分钟)。。。/Users/mac/.npm packages/lib/node_modules/servless/node_modules/bluebird/js/release/async.js:61fn=函数(){throw arg;};^ServerlessError:ServerlessError:请求中包含的安全令牌无效。在新的ServerlessError(/Users/mac/.npm packages/lib/node_modules/serverless/lib/Error.js:17:11)位于ResourcesDeploy。(/Users/mac/.npm packages/lib/node_modules/serverless/lib/actions/ResourcesDeploy.js:241:25)位于ResourcesDeploy.tryCatcher(/Users/mac/.npm软件包/lib/node_modules/serverless/node_modules/bluebird/js/release/util.js:16:23)Promise_settlePromiseFromHandler(/Users/mac/.npm packages/lib/node_modules/servless/node_modules/bluebird/js/release/promise.js:502:31)Promise_settlePromise(/Users/mac/.npm packages/lib/node_modules/servless/node_modules/bluebird/js/release/promee.js:559:18)Promise_settlePromise0(/Users/mac/.npm packages/lib/node_modules/servless/node_modules/bluebird/js/release/promise.js:604:10)Promise_settlePromises(/Users/mac/.npm packages/lib/node_modules/servless/node_modules/bluebird/js/release/promee.js:679:18)异步_drainQueue(/Users/mac/.npm packages/lib/nod_module/servless/node_moduless/bluebird/js/release/async.js:138:16)异步_drainQueues(/Users/mac/.npm packages/lib/nod_module/servless/node_moduless/bluebird/js/release/async.js:148:10)在Immediate.Async.drainQueues[as_onImmediate](/Users/mac/.npm packages/lib/node_modules/servless/node_modules/bluebird/js/release/Async.js:17:14)在processImmediate[as_immediateCallback](timers.js:383:17)macs-MacBook-Pro-4:blog mac$node-v
当我使用现有的凭据集时,我得到:
/Users/mac/.npm packages/lib/node_modules/servless/node_modules/bluebird/js/release/async.js:61fn=函数(){throw arg;};^ServerlessError:ServerlessError:用户:arn:aws:iam::…:用户/@gmail.com未被授权在上执行:cloudformation:DescriptionStackResourcesresource:arn:aws:cloudformation:us-west-2:49562908449:stack/serverless-starter-dev-r/*
问题:如何解决安全令牌的问题?有没有一个详细的选项,我可以";买一个元音";?
我认为无服务框架正在使用aws-cli配置。您的主路径(/home/xxx/.aws/credentials
)上有一个文件,用于存储您的AWS凭据。可能您的凭据没有使用云信息的权限。(Servless广泛使用云信息)cloudformation:DescribeStackResources
。
您必须向用户授予权限(添加asws策略)才能对云形成执行操作。