class BeanstalkResource extends ResourceProvider {

  @Override
  public Attributes getAttributes() {
    File configFile = new File(configPath);
    if (!configFile.exists()) {
      return Attributes.empty();
    }

    Attributes.Builder attrBuilders = Attributes.newBuilder();
    try (JsonParser parser = JSON_FACTORY.createParser(configFile)) {
      parser.nextToken();

      if (!parser.isExpectedStartObjectToken()) {
        logger.log(Level.WARNING, "Invalid Beanstalk config: ", configPath);
        return attrBuilders.build();
      }

      while (parser.nextToken() != JsonToken.END_OBJECT) {
        parser.nextValue();
        String value = parser.getText();
        switch (parser.getCurrentName()) {
          case DEVELOPMENT_ID:
            attrBuilders.setAttribute(ResourceAttributes.SERVICE_INSTANCE, value);
            break;
          case VERSION_LABEL:
            attrBuilders.setAttribute(ResourceAttributes.SERVICE_VERSION, value);
            break;
          case ENVIRONMENT_NAME:
            attrBuilders.setAttribute(ResourceAttributes.SERVICE_NAMESPACE, value);
            break;
          default:
            parser.skipChildren();
        }
      }
    } catch (IOException e) {
      logger.log(Level.WARNING, "Could not parse Beanstalk config.", e);
      return Attributes.empty();
    }

    attrBuilders.setAttribute(
        ResourceAttributes.CLOUD_PROVIDER, AwsResourceConstants.cloudProvider());

    return attrBuilders.build();
  }

  public  BeanstalkResource();
  @VisibleForTesting  BeanstalkResource(String configPath);

}