docs: private AuthConfig getAuthConfigFromEC2InstanceRole() throws IOException {
          log.debug("No user and password set for ECR, checking EC2 instance role");
          try (CloseableHttpClient client = HttpClients.custom().useSystemProperties().build()) {
              // we can set very low timeouts because the request returns almost instantly on
              // an EC2 instance
              // on a non-EC2 instance we can fail early
              RequestConfig conf = RequestConfig.custom().setConnectionRequestTimeout(1000).setConnectTimeout(1000)
                      .setSocketTimeout(1000).build();
  
              // get instance role - if available
              HttpGet request = new HttpGet("http://169.254.169.254/latest/meta-data/iam/security-credentials");
              request.setConfig(conf);
              String instanceRole;
              try (CloseableHttpResponse response = client.execute(request)) {
                  if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) {
                      // no instance role found
                      log.debug("No instance role found, return code was %d", response.getStatusLine().getStatusCode());
                      return null;
                  }
  
                  // read instance role
                  try (InputStream is = response.getEntity().getContent()) {
                      instanceRole = IOUtils.toString(is, StandardCharsets.UTF_8);
                  }
              }
              log.debug("Found instance role %s, getting temporary security credentials", instanceRole);
  
              // get temporary credentials
              request = new HttpGet("http://169.254.169.254/latest/meta-data/iam/security-credentials/"
                      + UrlEscapers.urlPathSegmentEscaper().escape(instanceRole));
              request.setConfig(conf);
              try (CloseableHttpResponse response = client.execute(request)) {
                  if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) {
                      log.debug("No security credential found, return code was %d",
                              response.getStatusLine().getStatusCode());
                      // no instance role found
                      return null;
                  }
  
                  // read instance role
                  try (Reader r = new InputStreamReader(response.getEntity().getContent(), StandardCharsets.UTF_8)) {
                      JsonObject securityCredentials = new Gson().fromJson(r, JsonObject.class);
  
                      String user = securityCredentials.getAsJsonPrimitive("AccessKeyId").getAsString();
                      String password = securityCredentials.getAsJsonPrimitive("SecretAccessKey").getAsString();
                      String token = securityCredentials.getAsJsonPrimitive("Token").getAsString();
  
                      log.debug("Received temporary access key %s...", user.substring(0, 8));
                      return new AuthConfig(user, password, "none", token);
                  }
              }
          }
      }