Skip to content

Conversation

liutao-samsung
Copy link

My profile file:

[profile root]
mfa_serial=arn:aws-cn:iam::xxxxxxxxxxxx:mfa/mfa
region=cn-north-1
credential_process=aws-vault export --prompt=osascript --format=json root

[profile work]
role_arn = arn:aws-cn:iam::xxxxxxxxxxxx:role/to-assume
region=cn-north-1
source_profile = root

then I run:

av login work -s --debug

I got error:

2024/07/24 15:24:30 profile root: skipping GetSessionToken because profile 'work' has no MFA serial defined
...
2024/07/24 15:24:30 [keyring] Found item "aws-vault (root)"
aws-vault: error: login: operation error STS: AssumeRole, https response error StatusCode: 403, RequestID: 392da53b-2cc1-43dc-ac66-e8e0bed4ed84, api error AccessDenied: User: arn:aws-cn:iam::xxxxxxxxxx:user/mfa is not authorized to perform: sts:AssumeRole on resource: arn:aws-cn:iam::xxxxxxxxxx:role/to-assume

I think profile 'work' should use MFA config of profile 'root' . just like awscli.

➜ aws sts get-caller-identity --profile work --no-cli-pager
Enter MFA code for arn:aws-cn:iam::xxxxxxxxxx:mfa/mfa:

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

Successfully merging this pull request may close these issues.

1 participant