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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the configured instance.description(String description) Sets the value ofLifecycleRule.getDescription()maxImageAge(Duration maxImageAge) Sets the value ofLifecycleRule.getMaxImageAge()maxImageCount(Number maxImageCount) Sets the value ofLifecycleRule.getMaxImageCount()rulePriority(Number rulePriority) Sets the value ofLifecycleRule.getRulePriority()tagPrefixList(List<String> tagPrefixList) Sets the value ofLifecycleRule.getTagPrefixList()Sets the value ofLifecycleRule.getTagStatus()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
description
Sets the value ofLifecycleRule.getDescription()- Parameters:
description- Describes the purpose of the rule.- Returns:
this
-
maxImageAge
Sets the value ofLifecycleRule.getMaxImageAge()- 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
Sets the value ofLifecycleRule.getMaxImageCount()- Parameters:
maxImageCount- The maximum number of images to retain. Specify exactly one of maxImageCount and maxImageAge.- Returns:
this
-
rulePriority
Sets the value ofLifecycleRule.getRulePriority()- 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
-
tagPrefixList
Sets the value ofLifecycleRule.getTagPrefixList()- Parameters:
tagPrefixList- Select images that have ALL the given prefixes in their tag. Only if tagStatus == TagStatus.Tagged- Returns:
this
-
tagStatus
Sets the value ofLifecycleRule.getTagStatus()- 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
Builds the configured instance.- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<LifecycleRule>- Returns:
- a new instance of
LifecycleRule - Throws:
NullPointerException- if any required attribute was not provided
-