2

Provided with an AWS Account alias, I would like to convert it to an AWS Account ID. I don't think there is an API for this, as the IAM alias commands in boto3 are limited to create, delete and list, but I figured I would at least ask the community.

My use case is to allow a user to provide either an account alias or account ID to the sts.assume_role() call. If an account ID is specified, great, we can simply build a role_arn from that and pass it to the function call. If an account alias is provided, we need to first convert it to an account ID, then build the role_arn in the same fashion.

JJJ
  • 32,902
  • 20
  • 89
  • 102
aidanmelen
  • 6,194
  • 1
  • 23
  • 24
  • I think it's impossible unless user provide you some credentials. Then you can refer to [Get AWS Account ID from Boto](https://stackoverflow.com/questions/36709461/get-aws-account-id-from-boto) to do this. – LiuChang Aug 26 '19 at 03:00
  • yeah I think so too... I guess account id's are sensitive and this is a security constraint. – aidanmelen Aug 26 '19 at 15:11

0 Answers0