private boolean createTag() {
    long tagTriggerTimestampMillis = getTagTriggerTimestampMillis();
    Snapshot snapshot = findSnapshot(table, tagTriggerTimestampMillis);
    if (snapshot == null) {
      LOG.info("Found no snapshot at {} for {}", tagTriggerTimestampMillis, table.name());
      return false;
    }
    if (exceedMaxDelay(snapshot)) {
      LOG.info(
          "{}'s snapshot {} at {} exceeds max delay {}, and the expected trigger time is {}",
          table.name(),
          snapshot.snapshotId(),
          snapshot.timestampMillis(),
          tagConfig.getMaxDelayMinutes(),
          tagTriggerTimestampMillis);
      return false;
    }
    ManageSnapshots tag = table.manageSnapshots().createTag(tagName, snapshot.snapshotId());
    if (tagConfig.getTagMaxAgeMs() > 0) {
      tag.setMaxRefAgeMs(tagName, tagConfig.getTagMaxAgeMs());
    }
    tag.commit();
    LOG.info(
        "Created a tag {} for {} on snapshot {} at {}",
        tagName,
        table.name(),
        snapshot.snapshotId(),
        snapshot.timestampMillis());
    return true;
  }
Action to auto create tag for Iceberg Table.
amoro-ams/src/main/java/org/apache/amoro/server/optimizing/maintainer/AutoCreateIcebergTagAction.java