我正在玩 boto 并尝试使用 FPS 获取我的帐户余额。我已导出 AWS 访问密钥和密钥。
$ env | grep AWS
AWS_SECRET_ACCESS_KEY=xxxxxxxxxxxx
AWS_ACCESS_KEY_ID=xxxxxxxxxxxx
当我尝试连接到 ec2 并获取所有实例时,我的代码工作正常。但是,当我尝试使用 python 的交互模式使用 FPS 时,我收到了这个错误:
>>> import boto
>>> fc=boto.connect_fps('fps.amazonaws.com')
>>> fc.get_account_balance()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Python/2.7/site-packages/boto/fps/connection.py", line 95, in wrapper
return func(self, action, response, *args, **kw)
File "/Library/Python/2.7/site-packages/boto/fps/connection.py", line 183, in get_account_balance
return self.get_object(action, {}, response)
File "/Library/Python/2.7/site-packages/boto/connection.py", line 1204, in get_object
raise self.ResponseError(response.status, response.reason, body)
boto.fps.exception.InvalidClientTokenId: FPS Response Error: 403 InvalidClientTokenId
The AWS Access Key Id you provided does not exist in our records.
The AWS Access Key Id you provided does not exist in our records.
我究竟做错了什么?我应该使用不同的 AWS 访问密钥吗?我的 AWS 访问密钥具有管理员权限,并且我已激活 IAM 进行计费。我究竟做错了什么?