diff --git a/awscli/botocore/credentials.py b/awscli/botocore/credentials.py index 54470fc33f7d..f99ea5e5afb8 100644 --- a/awscli/botocore/credentials.py +++ b/awscli/botocore/credentials.py @@ -1495,6 +1495,7 @@ def load(self): access_key, secret_key = self._extract_creds_from_mapping( credentials, self.ACCESS_KEY, self.SECRET_KEY ) + register_feature_id('CREDENTIALS_BOTO2_CONFIG_FILE') return Credentials( access_key, secret_key, method=self.METHOD ) diff --git a/awscli/botocore/useragent.py b/awscli/botocore/useragent.py index c7798e2b3486..00793a04bfa7 100644 --- a/awscli/botocore/useragent.py +++ b/awscli/botocore/useragent.py @@ -91,6 +91,7 @@ 'CREDENTIALS_SSO': 's', 'CREDENTIALS_PROFILE_SSO_LEGACY': 't', 'CREDENTIALS_SSO_LEGACY': 'u', + 'CREDENTIALS_BOTO2_CONFIG_FILE': 'x', 'CREDENTIALS_HTTP': 'z', 'CREDENTIALS_IMDS': '0', 'BEARER_SERVICE_ENV_VARS': '3', diff --git a/tests/functional/botocore/test_credentials.py b/tests/functional/botocore/test_credentials.py index 09313b464f98..ffa3f4c0fa15 100644 --- a/tests/functional/botocore/test_credentials.py +++ b/tests/functional/botocore/test_credentials.py @@ -1183,6 +1183,34 @@ def add_credential_response(self, stubber): [], 'e', ), + # Test case 5: Credentials set with Boto2 config + ( + {}, + {}, + [ + patch( + "botocore.configloader.raw_config_parse", + return_value={ + "Credentials": { + "aws_access_key_id": "FAKEACCESSKEY", + "aws_secret_access_key": "FAKESECRETKEY", + } + }, + ), + patch( + "botocore.credentials.ConfigProvider.load", + return_value=None, + ), + patch( + "botocore.credentials.SharedCredentialProvider.load", + return_value=None, + ), + patch( + "botocore.credentials.EnvProvider.load", return_value=None + ), + ], + 'x', + ), # Test case 6: Credentials set via process provider ( {},