我尝试使用aws
与ClaudiaJS所以首先我downlolad Hello World示例从claudiajs Github上,然后在我的AWS创建这些用户AWSLambdaFullAccess
,IAMFullAccess
并AmazonAPIGatewayAdministrator
,然后配置.aws/credentials
与文件awscli
克劳迪亚并从默认的变化曲线的名字,现在我的凭据是这样的:
[claudia]
aws_access_key_id = xxxxxxxxx
aws_secret_access_key = xxxxxx
之后,按照教程运行npm i
,然后运行npm start
.script脚本,如下所示:
"scripts": {
"start": "claudia create --name hello-world --region us-east-1 --handler main.handler",
"test": "claudia test-lambda",
"deploy": "claudia update"
},
但是在npm start
我得到这些错误之后:
npm start
> [email protected] start /home/interact/Try/hello-world
> claudia create --name hello-world --region us-east-1 --handler
main.handler
initialising IAM role iam.createRole RoleName=hello-world-executor
{ Error: connect EHOSTUNREACH 169.254.169.254:80
at Object._errnoException (util.js:992:11)
at _exceptionWithHostPort (util.js:1014:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1186:14)
message: 'Missing credentials in config',
code: 'CredentialsError',
errno: 'EHOSTUNREACH',
syscall: 'connect',
address: '169.254.169.254',
port: 80,
time: 2018-06-13T07:50:47.292Z,
originalError:
{ message: 'Could not load credentials from any providers',
code: 'CredentialsError',
errno: 'EHOSTUNREACH',
syscall: 'connect',
address: '169.254.169.254',
port: 80,
time: 2018-06-13T07:50:47.292Z,
originalError:
{ code: 'EHOSTUNREACH',
errno: 'EHOSTUNREACH',
syscall: 'connect',
address: '169.254.169.254',
port: 80,
message: 'connect EHOSTUNREACH 169.254.169.254:80' } } }
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `claudia create --name hello-world --region us-east-1 --handler main.handler`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely
additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/interact/.npm/_logs/2018-06-13T07_50_47_317Z-
debug.log
消息是:
enter code here`message: 'Could not load credentials from any providers'
我在SF和网上进行搜索,但没有找到可以解决我问题的方法。
我的节点版本是v8.11.3
,npm版本是5.6.0
您可以通过两种方式轻松解决问题
1.通过更改.aws / credentials文件。将[claudia]重命名为[默认]
[default]
aws_access_key_id = xxxxxxxxx
aws_secret_access_key = xxxxxxxxx
2.设置AWS_PROFILE环境变量。
AWS_PROFILE=deployment claudia <options>
如果您需要多个AWS cli用户,则可以使用这种方式添加。
修改.aws / credentials文件
[default]
aws_access_key_id = xxxxxxxxx
aws_secret_access_key = xxxxxxxxx
[claudia]
aws_access_key_id = xxxxxxxxx
aws_secret_access_key = xxxx
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句