If an account does not have an account alias, cs.py fails:
$ python cs.py
Traceback (most recent call last):
File "/app/cs.py", line 16, in <module>
account_name = account_details['AccountAliases'][0]
IndexError: list index out of range
$ aws iam list-account-aliases
{
"AccountAliases": []
}
This PR adds a fallback to aws sts get-caller-identity in this case.
If an account does not have an account alias,
cs.py
fails:This PR adds a fallback to
aws sts get-caller-identity
in this case.