aws4-axios
aws4-axios copied to clipboard
AssumeRoleCredentialsProvider does not allow passing credentials
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.
https://github.com/jamesmbourne/aws4-axios/blob/9066b38c73a575bdae28bcdd81cfbe3ce318b2e3/src/interceptor.ts#L69-L76
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
Encounter the same issue when integrate multiple AWS profiles. @moltar did you found any workaround?
@jamesmbourne any thoughts?
You could write your own CredentialsProvider
based on AssumeRoleCredentialsProvider
.