code: function saveCredentialsInAWS(profile = 'default') {
      credentials = new AWS.SharedIniFileCredentials({ profile });
      return new Promise((resolve, reject) =>
          credentials.refresh(err => {
              if (err) {
                  reject(err);
              }
              AWS.config.credentials = credentials;
              resolve();
          })
      );
  }
docs: Get the credentials from the ~/.aws/credentials file using the AWS_PROFILE env var to get the profile.
  
  @param profile The AWS profile to get the credentials from. Default to 'default'
  @returns {Promise} Will resolve with no parameters if it succeeds, rejects with the error if it fails (no credentials found for given profile.