How the Default Credential Provider Chain works
masterIf no client is explicitly created before a request, the SDK automatically attempts to create a default client using the following order of precedence:
- Environment Credentials: Checks for
ALIBABA_CLOUD_ACCESS_KEY_IDandALIBABA_CLOUD_ACCESS_KEY_SECRETenvironment variables. - Credentials File: Looks for a configuration file at
~/.alibabacloud/credentials(or%UserProfile%\.alibabacloud\credentialson Windows). The file path can be overridden by setting theALIBABA_CLOUD_CREDENTIALS_FILEenvironment variable. - Instance RAM Role: If
ALIBABA_CLOUD_ECS_METADATAis set, the SDK uses that value as a role name to fetch temporary credentials from the ECS metadata service (http://100.100.100.200/latest/meta-data/ram/security-credentials/).