【问题标题】:Using Boto to connect to FPS to get account balance使用 Boto 连接 FPS 获取账户余额
【发布时间】:2014-11-30 09:04:31
【问题描述】:

我正在玩 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 进行计费。我做错了什么?

【问题讨论】:

    标签: python amazon-web-services boto amazon-fps


    【解决方案1】:

    IAM 不支持 FPS。您必须使用 root 帐户或 root + MFA。

    Services supported by IAM

    【讨论】:

    • 你能澄清一下你的意思是root帐户吗?我需要使用我的用户名和密码吗?此页面似乎表明可以使用 IAM 访问计费。我错过了什么? docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/…
    • FPS 代表灵活支付系统,允许开发者在网站上接受支付。那是你想要做的吗?或者您正在查看您欠 AWS 的金额?
    • 啊哈。我认为 FPS 帮助我获取了我的账单信息和资料。我想我错了。是不是都提供了其他接口来实现这一点?
    • AWS 不提供 API 来获取账单信息。 See my response to a similar question here
    • 谢谢。这很有帮助。
    猜你喜欢
    • 2011-12-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-08-17
    • 2021-07-22
    • 2020-01-14
    • 2015-11-25
    相关资源
    最近更新 更多