-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
I'm evaluating awsapilib to see whether it can help me automate the building of a landing zone.
I have root user credentials for an AWS account that I just created today.
I know the credentials are valid because I used them to log into the console and retrieve the account ID.
I try to do the same using the AccountManager class.
from awsapilib import AccountManager
email="..."
password="..."
region="eu-west-1"
am = AccountManager(email, password, region)
print(am.account_id)I expect this to print an account ID like 111111111111.
Instead it prints a traceback and an error about invalidate credentials.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/isme/.cache/pypoetry/virtualenvs/control-tower-RVRvYoiX-py3.8/lib/python3.8/site-packages/awsapilib/console/console.py", line 765, in account_id
session = self._get_billing_session(self.email,
File "/home/isme/.cache/pypoetry/virtualenvs/control-tower-RVRvYoiX-py3.8/lib/python3.8/site-packages/awsapilib/console/console.py", line 559, in _get_billing_session
redirect_url = self._get_root_console_redirect(email, password, session, mfa_serial=mfa_serial)
File "/home/isme/.cache/pypoetry/virtualenvs/control-tower-RVRvYoiX-py3.8/lib/python3.8/site-packages/awsapilib/console/console.py", line 552, in _get_root_console_redirect
raise InvalidAuthentication(f'Unable to authenticate, response received was: {response.text} '
awsapilib.console.consoleexceptions.InvalidAuthentication: Unable to authenticate, response received was: {"state":"FAIL","properties":{"Message":"Your authentication information is incorrect. Please try again.","Title":"Authentication failed"}} with status code: 200
Metadata
Metadata
Assignees
Labels
No labels