Closed
Description
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.