@Provides
  @Singleton
  @ProjectId
  String provideProjectId() {
    validateUsingGoogle(cloud);
    String projectId;
    try {
      projectId = GoogleCloudUtils.getProjectId();
    } catch (NullPointerException e) {
      throw new IllegalArgumentException(
          "Need to specify a project ID when using Google Cloud. "
              + "This should be exposed as an environment variable by Kubernetes, see "
              + "k8s/api-deployment.yaml");
    }
    Preconditions.checkArgument(
        !Strings.isNullOrEmpty(projectId),
        "Need to specify a project "
            + "ID when using Google Cloud. This should be exposed as an environment variable by "
            + "Kubernetes, see k8s/api-deployment.yaml");
    return projectId;
  }
Get project ID from environment variable and validate it is set.

@throws IllegalArgumentException if project ID is unset
extensions/cloud/portability-cloud-google/src/main/java/org/datatransferproject/cloud/google/GoogleCloudExtensionModule.java