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

AssumeRoleCredentialsProvider does not allow passing credentials #140

Open
moltar opened this issue Mar 10, 2021 · 3 comments
Open

AssumeRoleCredentialsProvider does not allow passing credentials #140

moltar opened this issue Mar 10, 2021 · 3 comments

Comments

@moltar
Copy link

moltar commented Mar 10, 2021

It looks like AssumeRoleCredentialsProvider assumes the credentials are coming from the environment, and there is no way to pass them explicitly.

The entry point is here, which decides whether to use credentials OR role.

const credentialsProvider =
options?.assumeRoleArn && !credentials
? new AssumeRoleCredentialsProvider({
roleArn: options.assumeRoleArn,
region: options.region,
expirationMarginSec: options.assumedRoleExpirationMarginSec,
})
: new SimpleCredentialsProvider(credentials);

But I think it is a valid use case to provide credentials, which will be used for STS.

Docs: https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/STS.html#constructor-property

image

@michael-land
Copy link

michael-land commented Oct 25, 2021

Encounter the same issue when integrate multiple AWS profiles. @moltar did you found any workaround?

@michael-land
Copy link

@jamesmbourne any thoughts?

@scottanderson42
Copy link

You could write your own CredentialsProvider based on AssumeRoleCredentialsProvider.

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

3 participants