Skip to content

AWS_PROFILE won't honor credentials_process in configuration #1772

Closed
@christophgysin

Description

@christophgysin

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions