-
Notifications
You must be signed in to change notification settings - Fork 615
Call fromTokenFile
credential provider by default in credential-provider-node
#2148
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
Comments
This would be very helpful as this is how the cli works. Right now I'm using EKS Service roles which sets both
@trivikr any idea if this is something that will be added in? |
In case someone stumbles upon this issue, here is an example of how this could be implemented import { fromTokenFile } from '@aws-sdk/credential-provider-web-identity'
import { ECRClient } from '@aws-sdk/client-ecr'
import { getDefaultRoleAssumerWithWebIdentity } from '@aws-sdk/client-sts'
export const client = new ECRClient({
region: process.env.AWS_REGION || 'some-region-name',
credentialDefaultProvider: () =>
fromTokenFile({
webIdentityTokenFile: process.env.AWS_WEB_IDENTITY_TOKEN_FILE,
roleArn: process.env.AWS_ROLE_ARN,
roleAssumerWithWebIdentity: getDefaultRoleAssumerWithWebIdentity(),
}),
}),
}) Note that References: |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread. |
Is your feature request related to a problem? Please describe.
The credential provider which gets credentials using sts:assumeRoleWithWebIdentity call after reading OIDS token from a file on a disk was added in #2147
It isn't called in default Node.js crendential provider chain due to a circular dependency issue.
Details: #1808 (comment)
Describe the solution you'd like
Call
fromTokenFile
credential provider by default in credential-provider-nodeDescribe alternatives you've considered
Explicitly calling
fromTokenFile
while creating client instance.The text was updated successfully, but these errors were encountered: