constructor()

in src/ram_role_arn_credential.ts [13:39]


  constructor(config: Config, runtime: {[key: string]: any} = {}) {
    if (!config.accessKeyId) {
      throw new Error('Missing required accessKeyId option in config for ram_role_arn');
    }

    if (!config.accessKeySecret) {
      throw new Error('Missing required accessKeySecret option in config for ram_role_arn');
    }

    if (!config.roleArn) {
      throw new Error('Missing required roleArn option in config for ram_role_arn');
    }

    const conf = new Config({
      type: 'ram_role_arn',
      accessKeyId: config.accessKeyId,
      accessKeySecret: config.accessKeySecret,
      securityToken: config.securityToken
    });
    super(conf);
    this.roleArn = config.roleArn;
    this.policy = config.policy;
    this.durationSeconds = config.roleSessionExpiration || 3600;
    this.roleSessionName = config.roleSessionName || 'role_session_name';
    this.runtime = runtime;
    this.host = 'https://sts.aliyuncs.com';
  }