tilfinltd / aws-extend-switch-roles

Extend your AWS IAM switching roles by Chrome extension, Firefox add-on, or Edge add-on
https://chromewebstore.google.com/detail/aws-extend-switch-roles/jpmkfafbacpgapdghgdpembnojdlgkdl?utm_source=github
MIT License
1.32k stars 141 forks source link

Using Both Account ID and Alias Workaround #230

Closed WillJCJ closed 1 year ago

WillJCJ commented 2 years ago

In the Complex Configuration section of the extension's settings, it states:

If your account is aliased, the alias will be shown in the role dropdown after 'Account:'. You MUST use that alias as the aws_account_id for the base account instead of the numerical account id or your configuration won't work as expected.

However, if I just insert two profiles with the same name, I can use both! Is this already known? I can log in using the account ID and I'm given all the available roles. I then log back in using the alias and I have the same list.

Would it be possible to make this a bit more user-friendly? Also, would this work in all cases or am I just lucky that my workaround works for me?

This is especially useful when sharing the configuration between colleagues because I can't guarantee they'll stick to using only an alias or only an ID.

My configuration:

[management]
aws_account_id = my-alias

[management]
aws_account_id = 123456789012

[child-account]
aws_account_id = another-alias
role_name = rolename
source_profile = management
tilfin commented 2 years ago

I reviewed the implementation again. It certainly works with that. But that definition is not valid for the INI format because of duplicate section, so I think we should provide another solution.

tilfin commented 1 year ago

AESR supports aws_account_alias parameter at v2.3.2.