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

AWS_PROFILE won't honor credentials_process in configuration #1772

Closed
christophgysin opened this issue Dec 13, 2020 · 1 comment · Fixed by #1773
Closed

AWS_PROFILE won't honor credentials_process in configuration #1772

christophgysin opened this issue Dec 13, 2020 · 1 comment · Fixed by #1773
Labels
bug This issue is a bug.

Comments

@christophgysin
Copy link
Contributor

Describe the bug
I have a ~/.aws/config with a profile that defines a credentials_process:

[profile myprofile]
credential_process = aws-vault exec -nj myprofile

This works with the aws-cli:

$ AWS_PROFILE=myprofile aws s3 ls

And with aws-sdk-v2 (using AWS_SDK_LOAD_CONFIG=1):

import { S3 } from 'aws-sdk'
new S3().listBuckets().promise().then(console.log)
$ AWS_SDK_LOAD_CONFIG=1 AWS_PROFILE=myprofile ts-node s3-ls-v2.ts

It seems that aws-sdk-v3 does not consider credentials_process:

import { S3 } from '@aws-sdk/client-s3'
new S3({}).listBuckets({}).then(console.log)
$ AWS_REGION=eu-west-1 AWS_SDK_LOAD_CONFIG=1 AWS_PROFILE=myprofile ts-node s3-ls-v3.ts
[...]
Error: Profile myprofile could not be found or parsed in shared credentials file.

This seems to be caused by credential-provider-node, which is not considering fromProcess if a profile is given in the environment:
https://github.com/aws/aws-sdk-js-v3/blob/master/packages/credential-provider-node/src/index.ts#L45-L48

SDK version number
1.0.0-rc.9

Is the issue in the browser/Node.js/ReactNative?
Node

Details of the browser/Node.js/ReactNative version
v15.4.0

To Reproduce (observed behavior)
See description above.

Expected behavior
Get credentials from credentials_process in profile.

christophgysin added a commit to christophgysin/aws-sdk-js-v3 that referenced this issue Dec 13, 2020
@AllanZhengYP AllanZhengYP added the bug This issue is a bug. label Dec 14, 2020
AllanZhengYP pushed a commit that referenced this issue Dec 19, 2020
…1773)

* feat(credential-provider-node): use credential_process from profile

fixes #1772

* feat(credential-provider-node): add testcase
@github-actions
Copy link

github-actions bot commented Jan 8, 2021

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants