Class LifecycleRule.Builder

java.lang.Object
software.amazon.awscdk.services.ecr.LifecycleRule.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<LifecycleRule>
Enclosing interface:
LifecycleRule

@Stability(Stable) public static final class LifecycleRule.Builder extends Object implements software.amazon.jsii.Builder<LifecycleRule>
A builder for LifecycleRule
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • description

      @Stability(Stable) public LifecycleRule.Builder description(String description)
      Parameters:
      description - Describes the purpose of the rule.
      Returns:
      this
    • maxImageAge

      @Stability(Stable) public LifecycleRule.Builder maxImageAge(Duration maxImageAge)
      Parameters:
      maxImageAge - The maximum age of images to retain. The value must represent a number of days. Specify exactly one of maxImageCount and maxImageAge.
      Returns:
      this
    • maxImageCount

      @Stability(Stable) public LifecycleRule.Builder maxImageCount(Number maxImageCount)
      Parameters:
      maxImageCount - The maximum number of images to retain. Specify exactly one of maxImageCount and maxImageAge.
      Returns:
      this
    • rulePriority

      @Stability(Stable) public LifecycleRule.Builder rulePriority(Number rulePriority)
      Parameters:
      rulePriority - Controls the order in which rules are evaluated (low to high). All rules must have a unique priority, where lower numbers have higher precedence. The first rule that matches is applied to an image.

      There can only be one rule with a tagStatus of Any, and it must have the highest rulePriority.

      All rules without a specified priority will have incrementing priorities automatically assigned to them, higher than any rules that DO have priorities.

      Returns:
      this
    • tagPatternList

      @Stability(Stable) public LifecycleRule.Builder tagPatternList(List<String> tagPatternList)
      Parameters:
      tagPatternList - Select images that have ALL the given patterns in their tag. There is a maximum limit of four wildcards () per string. For example, ["test123", "test123*"] is valid but ["test123456"] is invalid.

      Both tagPrefixList and tagPatternList cannot be specified together in a rule.

      Only if tagStatus == TagStatus.Tagged

      Returns:
      this
    • tagPrefixList

      @Stability(Stable) public LifecycleRule.Builder tagPrefixList(List<String> tagPrefixList)
      Parameters:
      tagPrefixList - Select images that have ALL the given prefixes in their tag. Both tagPrefixList and tagPatternList cannot be specified together in a rule.

      Only if tagStatus == TagStatus.Tagged

      Returns:
      this
    • tagStatus

      @Stability(Stable) public LifecycleRule.Builder tagStatus(TagStatus tagStatus)
      Parameters:
      tagStatus - Select images based on tags. Only one rule is allowed to select untagged images, and it must have the highest rulePriority.
      Returns:
      this
    • build

      @Stability(Stable) public LifecycleRule build()
      Builds the configured instance.
      Specified by:
      build in interface software.amazon.jsii.Builder<LifecycleRule>
      Returns:
      a new instance of LifecycleRule
      Throws:
      NullPointerException - if any required attribute was not provided