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

Doesn't work with federated accounts #7

Open
Speculor opened this issue Jul 21, 2020 · 1 comment
Open

Doesn't work with federated accounts #7

Speculor opened this issue Jul 21, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@Speculor
Copy link

Speculor commented Jul 21, 2020

Using a federated (ie SSO) account does not work with the existing aws_mixin.rb. It throws the following:
Must specify userName when calling with non-User credentials (Aws::IAM::Errors::ValidationError)
To fix I had to update the get_aws_account_id method at line 34 to use the STS client instead of the IAM client:

def get_aws_account_id(credentials:)
    iam = Aws::STS::Client.new(region: 'us-east-1', credentials: credentials)
    user = iam.get_caller_identity
    user[:arn].match('^arn:aws:sts::([0-9]{12}):.*$')[1]
  end
end
@ecout
Copy link

ecout commented Apr 14, 2021

Did you submit a pull request? Thanks!

@rayjanoka rayjanoka added the enhancement New feature or request label Feb 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants