amazon-web-services - Elastic Beanstalk eb cli 不接受 AWS 教育凭证

标签 amazon-web-services amazon-elastic-beanstalk ebcli

当我登录我的 awseducate 帐户并单击帐户详细信息时,我会获得我的凭据。 See the credentials generated by the account

我成功地将这些凭据与我的 S3 存储桶一起使用来上传和下载文件。但是,当我尝试将这些凭据与弹性 beanstalk 服务 - ebcli(eb init 命令)一起使用时,我收到消息错误:NotAuthorizedError - 操作被拒绝。请求中包含的安全 token 无效。

F:\cloud-developer-master\course-02\project\image-filter-starter-code>eb init

Select a default region
1) us-east-1 : US East (N. Virginia)
2) us-west-1 : US West (N. California)
3) us-west-2 : US West (Oregon)
4) eu-west-1 : EU (Ireland)
...
(default is 3): 1
You have not yet set up your credentials or your credentials are incorrect
You must provide your credentials.
(aws-access-id): ASIxxxxxxxxxxxxxxxxxxxxxxxx
(aws-secret-key): hVCExxxxxxxxxxxxxxxxxxxxxxx
ERROR: NotAuthorizedError - Operation Denied. The security token included in the request is invalid.

有什么线索说明为什么这些不被接受吗?

注意:我无法使用新用户创建新凭证,因为此 AWS 学生账户不允许执行此操作。 我尝试引用页面以获取新凭据,但仍然没有成功。

我尝试创建 .aws/credentials 文件并复制并粘贴这些凭证,但仍未被接受:

F:\cloud-developer-master\course-02\project\image-filter-starter-code>eb init

Select a default region
1) us-east-1 : US East (N. Virginia)
2) us-west-1 : US West (N. California)
3) us-west-2 : US West (Oregon)
...
(default is 3): 1
ERROR: The current user does not have the correct permissions. Reason: Operation Denied. The security token included in the request is invalid.
ERROR: The current user does not have the correct permissions. Reason: Operation Denied. The security token included in the request is invalid.
You have not yet set up your credentials or your credentials are incorrect
You must provide your credentials.
(aws-access-id): ASIxxxxxxxxxxxxxxxxxxxxxxxxxxxx
(aws-secret-key): 1Ssxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ERROR: NotAuthorizedError - Operation Denied. The security token included in the request is invalid.

最佳答案

感谢一个使用伪Gambit-的人,我找到了问题的解决方案( details here )。 您必须在文件夹中创建两个文件:C:\Users\YOURUSERNAME\.aws

配置

[default] 
region = us-east-1 # replace this with your region (don't select it in the CLI) 
output = json

凭据

[default]
aws_access_key_id=REPLACE_WITH_YOUR_ACCESS_KEY
aws_secret_access_key=REPLACE_WITH_YOUR_SECRET_KEY
aws_session_token=REPLACE_WITH_YOUR_TOKEN

一点解释: 当您在 cmd 中选择区域时,eb-cli 将通过生成并存储名为 [eb cli] 的新配置文件来自动更新 config 文件,该配置文件将填充您在 cmd 中选择的信息。但是,我确实将配置文件 [default] 放入了文件 credentials 中,这是两个不同的配置文件。因此,认证失败。

另外,感谢约翰·罗滕斯坦的帮助

关于amazon-web-services - Elastic Beanstalk eb cli 不接受 AWS 教育凭证,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58885286/

相关文章:

node.js - 使用端口 80 的 AWS Elastic Beanstalk 上的 WebSocket 问题

amazon-web-services - 在 Elastic Beanstalk 中提交 .elasticbeanstalk/config.yml

amazon-web-services - 使用 eb-cli 创建单实例 Elastic Beanstalk 应用程序

amazon-web-services - 如何解决 AWS S3 中的 'HttpVersionNotSupported' 错误?

amazon-web-services - 如何将 AWS Nitro Enclave 与 ECS 结合使用?

amazon-web-services - 云形成: Assign Elastic IP to Auto Scaling group with one instance

python - 使用pyspark从s3位置读取 Parquet 文件的文件夹到pyspark数据框

node.js - AWS Elastic Beanstalk 中的 pm2 重启循环( Node 环境)

nginx - ElasticBeanstalk 上的 Websockets 给出 404