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

Support for AWS China accounts #111

Open
ansromanov opened this issue Oct 17, 2023 · 0 comments
Open

Support for AWS China accounts #111

ansromanov opened this issue Oct 17, 2023 · 0 comments

Comments

@ansromanov
Copy link

I'm trying to use aws-mfa-login with an AWS China account and get the following error:

aws-mfa-login --config ~/.aws-cn.yaml
#####
source: aws-cn
destination: aws-cn-mfa
#####
2023/10/17 12:52:36 operation error STS: GetCallerIdentity, https response error StatusCode: 403, RequestID: c1895db0-5866-4a35-a447-367de51b1d4f, api error InvalidClientTokenId: The security token included in the request is invalid.

The issue is rising because aws-mfa-login is trying to log in with the eu-central-1 account which is absent in AWS China.
The quick fix is to remove the hardcoded region from func (updater *CredUpdater) init() function:
https://github.com/signavio/aws-mfa-login/blob/v0.1.28/action/login.go#L43

I've checked this quick fix and it works pretty well for both aws and aws-cn accounts.

What else do you think should be taken into consideration?
As I see github.com/aws/aws-sdk-go-v2 handles different IAM partitions well and no code changes are needed here:

AWS - arn:aws:: ....
AWS China- arn:aws-cn:: ...
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

1 participant