amazon-web-services - Ubuntu、无服务器框架、AWS 凭证失败
问题描述
我似乎无法让我的 AWS 提供商在 Docker 容器中使用我的 AWS 凭证
到目前为止,我已经运行了所有这些
serverless config credentials --provider provider --key key --secret secret
&
aws configure
☝️浏览提示并插入我的信息
&
export AWS_ACCESS_KEY_ID=blah
export AWS_SECRET_ACCESS_KEY=blah
export AWS_DEFAULT_REGION=east-whatever
但是,仍然被 AWS 阻止
ServerlessError: AWS provider credentials not found. Learn how to set up AWS provider credentials in our docs here:.
我还生成并重新生成了我的 IAM 信用多次时间,当我运行aws configure list
它时也会返回
Name Value Type Location
---- ----- ---- --------
profile <not set> None None
access_key ****************67GT shared-credentials-file
secret_key ****************6glt shared-credentials-file
region us-east-2 config-file ~/.aws/config
我不知道还能做什么,我在 Ubuntu 20.04 上使用 Bash
解决方案
我将采取使用 aws-cli 设置所有内容的方法(因此 aws cli 安装是 imp)
- 安装 aws cli
- 运行
aws configure
-> 输入您的凭据,此信息将存储default
在 ~/.aws/credentials 文件中调用的配置文件中。文档。 - 通过检查
~/.aws/config ~/.aws.credentials
文件来验证您的配置 - 对于无服务器框架部署,请使用此
serverless deploy
. - 如果需要使用多个配置文件,请使用
sls deploy --aws-profile profile-name
推荐阅读
- python - 使用 python 将 csv 文件上传到 azure blob 存储
- javascript - “加入”两个数组
- bash - 在我的 ~/.bashrc 文件中创建“本地”别名后,自动填充失败
- python - Python:结合日期时间和数据框
- asp.net - 将 wcf 服务中的端点设置为特定于客户端。ASP.NET MVC
- angularjs - 连接 Angular-2
- docker - 如何授予容器权限以在 dockerfile 中的普通用户会话中运行
- javascript - MongoDB函数-引用收集和更新值
- git - 如何让 git 提醒我不需要的文件?
- php - 在控制器中传递新创建行的 ID