简体   繁体   中英

Using Boto to connect to FPS to get account balance

I'm playing with boto and trying to get my account balance using FPS. I've exported the AWS access key and secret.

$ env | grep AWS
AWS_SECRET_ACCESS_KEY=xxxxxxxxxxxx  
AWS_ACCESS_KEY_ID=xxxxxxxxxxxx

When I try to connect to ec2 and get all instances, my code works fine. But, when I try to use FPS using python's interactive mode, I get this error:

>>> 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.

What am I doing wrong? Is there a different AWS Access Key I should be using? My AWS access key has admin rights and I have activated IAM for billing. What am I doing wrong?

FPS is not supported by IAM. You have to use the root account or root + MFA.

Services supported by IAM

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM