Skip to content

Commit 11497f2

Browse files
committed
fix source_profile handling
1 parent 2025db0 commit 11497f2

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Credentials/CredentialProvider.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -705,6 +705,12 @@ private static function loadRoleProfile(
705705
$sourceProfileName = "";
706706
if (!empty($roleProfile['source_profile'])) {
707707
$sourceProfileName = $roleProfile['source_profile'];
708+
# in ~/.aws/config all the named profile (except 'default') are
709+
# prefix with 'profile '
710+
if ($filename == (self::getHomeDir() . '/.aws/config') &&
711+
$sourceProfileName != 'default') {
712+
$sourceProfileName = 'profile ' . $sourceProfileName;
713+
}
708714
if (!isset($profiles[$sourceProfileName])) {
709715
return self::reject("source_profile " . $sourceProfileName
710716
. " using profile " . $profileName . " does not exist"

0 commit comments

Comments
 (0)