-
Notifications
You must be signed in to change notification settings - Fork 26
Open
Description
I've noticed that this extension is ignoring source_profile
as defined in ~/.aws/config
.
Based on some cursory searches, it seems that this is because GetProfile
is trying to read the profiles out of the credentials file (~/.aws/credentials) instead of the config file:
Lines 60 to 79 in f855eb3
Aws::Config::Profile selected_profile; | |
// get file path where aws credentials are stored. | |
// comes from AWS_SHARED_CREDENTIALS_FILE | |
auto credentials_file_path = Aws::Auth::ProfileConfigFileAWSCredentialsProvider::GetCredentialsProfileFilename(); | |
// get the profile from within that file | |
Aws::Map<Aws::String, Aws::Config::Profile> profiles; | |
Aws::Config::AWSConfigFileProfileConfigLoader loader(credentials_file_path); | |
if (loader.Load()) { | |
profiles = loader.GetProfiles(); | |
for (const auto &entry : profiles) { | |
const Aws::String &profileName = entry.first; | |
if (profileName == profile_name) { | |
selected_profile = entry.second; | |
auto &url = selected_profile.GetValue("endpoint"); | |
return selected_profile; | |
} | |
} | |
} else { | |
throw InvalidInputException("Failed to load credentials file %s", credentials_file_path); | |
} |
GetCredentialsProfileFilename
instead of GetConfigProfileFilename
. Is there any known reason for this or should this just be changed to read out of the config file instead?Metadata
Metadata
Assignees
Labels
No labels