AWS CLI commands after AWS SDK credential store authentication

0

Hi, I'm trying to understand if it's possible to use AWS CLI commands after authenticating and storing credentials in the encrypted SDK credential store (RegisteredAccounts.json file).

I can successfully run the PowerShell tools commands such as Get-S3Bucket to list buckets, but AWS S3 LS or any other AWS command complains about the profile either not existing or not being found (if i try specify it with set AWS_PROFILE="myProfile"

All the documentation I read instructs me to use the AWS CONFIGURE command and create a profile with a credentials file but i don't understand how/if i can use the SDK credential store as the authentication source.

Any clarification appreciated

Dan
asked 2 years ago386 views
1 Answer
0
Accepted Answer

Hi,

I understand that you'd like to know if AWS CLI supports sourcing credentials from SDK store.

AWS CLI DOES NOT support sourcing credentials from the SDK store.

AWS Tools for PowerShell supports this feature as you have mentioned:

The AWS SDK for .NET and Toolkit for Visual Studio can also use the AWS SDK store.

However, please note that AWS CLI DOES NOT support sourcing credentials from the SDK store.

Since you want to use a named profile for CLI, you may follow the guidelines in the documentation below to achieve this use case:

To use a named profile for multiple commands, you can avoid specifying the profile in every command by setting the AWS_PROFILE environment variable at the command line. I believe this is what you are trying to achieve (please correct me if I'm wrong).

For Linux or macOS, you may set the AWS_PROFILE environment variable to use a profile called 'user1' as shown below:

$ export AWS_PROFILE=user1

For Windows, you may set the AWS_PROFILE environment variable to use a profile called 'user1' as shown below:

C:> setx AWS_PROFILE user1

Please let us know if you run into any further questions or concerns!

AWS
SUPPORT ENGINEER
answered 2 years ago
  • Understood thank you

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions