amazon-web-services - 使用 boto 连接到 aws - 凭证错误

标签 amazon-web-services boto

我尝试使用 boto 连接到 aws,但出现错误。

首先,我创建了一个 AWS 帐户,然后在管理控制台中单击 IAM 并创建了一个新用户。

此用户已关联 AWS_ACESS_KEY_ID 和 AWS_SECRET_ACESS_KEY。

然后我将此用户凭据存储在/etc/boto.cfg 和 ~/.boto 中,如下所示:

[Credentials]
aws_acess_key_id = ...
aws_secret_acess_key = ...

现在我尝试连接到 boto 但出现此错误:

Traceback (most recent call last):
  File "send.py", line 12, in <module>
    s3 = boto.connect_s3()
  File "/usr/local/lib/python2.7/dist-packages/boto-2.36.0-py2.7.egg/boto/__init__.py", line 141, in connect_s3
    return S3Connection(aws_access_key_id, aws_secret_access_key, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/boto-2.36.0-py2.7.egg/boto/s3/connection.py", line 190, in __init__
    validate_certs=validate_certs, profile_name=profile_name)
  File "/usr/local/lib/python2.7/dist-packages/boto-2.36.0-py2.7.egg/boto/connection.py", line 569, in __init__
    host, config, self.provider, self._required_auth_capability())
  File "/usr/local/lib/python2.7/dist-packages/boto-2.36.0-py2.7.egg/boto/auth.py", line 985, in get_auth_handler
    'Check your credentials' % (len(names), str(names)))
boto.exception.NoAuthHandlerFound: No handler was ready to authenticate. 1 handlers were checked. ['HmacAuthV1Handler'] Check your credentials

boto [DEBUG]:Retrieving credentials from metadata server.
[ERROR]:Caught exception reading instance data

你看出这里有什么问题了吗?

最佳答案

This is because boto cannot find credentials to use.

确保 boto.cfg 文件正确,并检查拼写,但按照 Troubleshooting Connections Problem 仍然存在问题

关于amazon-web-services - 使用 boto 连接到 aws - 凭证错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29729642/

相关文章:

javascript - 自动刷新 AWS Quicksight

javascript - 使用 aws js sdk 将大文件(>10GB)直接从浏览器安全地分段上传到 s3,而无需使用 cognito

python - 使用带有 EC2 的 boto 在服务器上处理并取回结果的最有效方法是什么?

amazon-web-services - 只允许 Lambda 函数调用 API Gateway

node.js - 无法从EC2访问具有IAM角色的S3文件

amazon-web-services - 亚马逊 500150 错误设置关闭连接一般 SSLEngine

python - 如何在 python boto 中创建 dynamodb 表

python - 在 sorl-thumbnail 中调用 get_thumbnail 时,是什么导致了这种偶发的 IntegrityError ?

python - 了解 Elastic Transcoder 的 boto 文档

amazon-web-services - 登录后使用 cognito 返回 401 的亚马逊负载均衡器