@Override
  public List<EnvironmentRevision> listEnvironmentRevisions(
      @NonNull final EnvironmentId environmentId) throws InternalServiceException {
    try {
      return dynamoDBMapper
          .query(
              EnvironmentRevisionDDBRecord.class,
              new DynamoDBQueryExpression<EnvironmentRevisionDDBRecord>()
                  .withHashKeyValues(
                      EnvironmentRevisionDDBRecord.withHashKey(
                          environmentId.generateAccountIdClusterEnvironmentName())))
          .stream()
          .map(environmentMapper::toEnvironmentRevision)
          .collect(Collectors.toList());
    } catch (final AmazonServiceException e) {
      throw new InternalServiceException(
          String.format(
              "Could not query environment revisions for environment %s", environmentId.toString()),
          e);
    }
  }
Check if environment revisions exist and clean them up.
data-service/src/main/java/com/amazonaws/blox/dataservice/repository/EnvironmentRepositoryDDB.java