I won't make a PR because those existing seem dead and don't want to waste my time, but know that the profile isn't correctly managed as it is now.
Current version (buggy):
if (program.profile) {
var newCreds = AWS.config.credentials;
newCreds.profile = program.profile;
AWS.config.update({ credentials: newCreds });
}
This doesn't work as expected, it doesn't select the credentials for the right profile but from the first defined profile. It may have worked with a very simple setup (1 profile) but doesn't really handle multi profiles.
Fixed version:
if (program.profile) {
var newCreds = new AWS.SharedIniFileCredentials({ profile: program.profile });
newCreds.profile = program.profile;
AWS.config.update({ credentials: newCreds });
}
I won't make a PR because those existing seem dead and don't want to waste my time, but know that the
profile
isn't correctly managed as it is now.Current version (buggy):
Fixed version:
See https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/loading-node-credentials-shared.html