Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question - How to get the Base/Org level account as an option? #281

Open
tyu0912 opened this issue Mar 3, 2023 · 1 comment
Open

Question - How to get the Base/Org level account as an option? #281

tyu0912 opened this issue Mar 3, 2023 · 1 comment

Comments

@tyu0912
Copy link

tyu0912 commented Mar 3, 2023

Hello good peoples. Wondering if anyone knows how to do this. I'm having some trouble getting the base account to show up as a potential choice for switching. Is this possible?

Currently, my setup looks something like this and basically I can't get Base to show up as an option. I'm wondering if it has something to do with how I've defined role_name under Base which is a federated role that begins with AWSReservedSSO.

Any help is appreciated!

[Base]
aws_account_id = 000000000
target_role_name = MySwapRole
role_name = MySuperRole

[Account1]
aws_account_id = 1111111111
source_profile = Base

[Account2]
aws_account_id = 222222222
source_profile = Base
@tilfin
Copy link
Member

tilfin commented Mar 5, 2023

For SSO login, only the permission set name must be specified in the role_name.

Perhaps the following logic is not working correctly due to a specification I am not yet aware of.

const RESERVED_SSO_PREFIX = "AWSReservedSSO_";
function extractLoginRole(role) {
if (role.startsWith(RESERVED_SSO_PREFIX)) {
// extract permission set from SSO role
const lastUnderscore = role.lastIndexOf('_');
return role.substr(RESERVED_SSO_PREFIX.length, lastUnderscore - RESERVED_SSO_PREFIX.length);
}
return role;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants