constructor()

in src/providers/default.ts [17:67]


  constructor(builder: DefaultCredentialsProviderBuilder) {
    this.providers = [];
    // Add static ak or sts credentials provider from env
    try {
      const envProvider = EnvironmentVariableCredentialsProvider.builder().build();
      this.providers.push(envProvider);
    } catch (ex) {
      // ignore
    }

    // oidc check
    try {
      const oidcProvider = OIDCRoleArnCredentialsProvider.builder().build();
      this.providers.push(oidcProvider);
    } catch (ex) {
      // ignore
    }

    // cli credentials provider
    try {
      const cliProfileProvider = CLIProfileCredentialsProvider.builder().build();
      this.providers.push(cliProfileProvider);
    } catch (ex) {
      // ignore
    }

    // profile credentials provider
    try {
      const profileProvider = ProfileCredentialsProvider.builder().build();
      this.providers.push(profileProvider);
    } catch (ex) {
      // ignore
    }

    // Add IMDS
    try {
      const ecsRamRoleProvider = ECSRAMRoleCredentialsProvider.builder().withRoleName(process.env.ALIBABA_CLOUD_ECS_METADATA).build();
      this.providers.push(ecsRamRoleProvider);
    } catch (ex) {
      // ignore
    }

    // credentials uri
    try {
      const uriProvider = URICredentialsProvider.builder().withCredentialsURI(process.env.ALIBABA_CLOUD_CREDENTIALS_URI).build();
      this.providers.push(uriProvider);
    }
    catch (ex) {
      // ignore
    }
  }