All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.awsx.ecr.inputs.LifecyclePolicyRuleArgs Maven / Gradle / Ivy

There is a newer version: 2.19.0-alpha.1731525651
Show newest version
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.awsx.ecr.inputs;

import com.pulumi.awsx.ecr.enums.LifecycleTagStatus;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import java.lang.Double;
import java.lang.String;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


/**
 * A lifecycle policy rule that determine which images in a repository should be expired.
 * 
 */
public final class LifecyclePolicyRuleArgs extends com.pulumi.resources.ResourceArgs {

    public static final LifecyclePolicyRuleArgs Empty = new LifecyclePolicyRuleArgs();

    /**
     * Describes the purpose of a rule within a lifecycle policy.
     * 
     */
    @Import(name="description")
    private @Nullable Output description;

    /**
     * @return Describes the purpose of a rule within a lifecycle policy.
     * 
     */
    public Optional> description() {
        return Optional.ofNullable(this.description);
    }

    /**
     * The maximum age limit (in days) for your images. Either [maximumNumberOfImages] or [maximumAgeLimit] must be provided.
     * 
     */
    @Import(name="maximumAgeLimit")
    private @Nullable Output maximumAgeLimit;

    /**
     * @return The maximum age limit (in days) for your images. Either [maximumNumberOfImages] or [maximumAgeLimit] must be provided.
     * 
     */
    public Optional> maximumAgeLimit() {
        return Optional.ofNullable(this.maximumAgeLimit);
    }

    /**
     * The maximum number of images that you want to retain in your repository. Either [maximumNumberOfImages] or [maximumAgeLimit] must be provided.
     * 
     */
    @Import(name="maximumNumberOfImages")
    private @Nullable Output maximumNumberOfImages;

    /**
     * @return The maximum number of images that you want to retain in your repository. Either [maximumNumberOfImages] or [maximumAgeLimit] must be provided.
     * 
     */
    public Optional> maximumNumberOfImages() {
        return Optional.ofNullable(this.maximumNumberOfImages);
    }

    /**
     * A list of image tag prefixes on which to take action with your lifecycle policy. Only used if you specified "tagStatus": "tagged". For example, if your images are tagged as prod, prod1, prod2, and so on, you would use the tag prefix prod to specify all of them. If you specify multiple tags, only the images with all specified tags are selected.
     * 
     */
    @Import(name="tagPrefixList")
    private @Nullable Output> tagPrefixList;

    /**
     * @return A list of image tag prefixes on which to take action with your lifecycle policy. Only used if you specified "tagStatus": "tagged". For example, if your images are tagged as prod, prod1, prod2, and so on, you would use the tag prefix prod to specify all of them. If you specify multiple tags, only the images with all specified tags are selected.
     * 
     */
    public Optional>> tagPrefixList() {
        return Optional.ofNullable(this.tagPrefixList);
    }

    /**
     * Determines whether the lifecycle policy rule that you are adding specifies a tag for an image. Acceptable options are tagged, untagged, or any. If you specify any, then all images have the rule evaluated against them. If you specify tagged, then you must also specify a tagPrefixList value. If you specify untagged, then you must omit tagPrefixList.
     * 
     */
    @Import(name="tagStatus", required=true)
    private Output tagStatus;

    /**
     * @return Determines whether the lifecycle policy rule that you are adding specifies a tag for an image. Acceptable options are tagged, untagged, or any. If you specify any, then all images have the rule evaluated against them. If you specify tagged, then you must also specify a tagPrefixList value. If you specify untagged, then you must omit tagPrefixList.
     * 
     */
    public Output tagStatus() {
        return this.tagStatus;
    }

    private LifecyclePolicyRuleArgs() {}

    private LifecyclePolicyRuleArgs(LifecyclePolicyRuleArgs $) {
        this.description = $.description;
        this.maximumAgeLimit = $.maximumAgeLimit;
        this.maximumNumberOfImages = $.maximumNumberOfImages;
        this.tagPrefixList = $.tagPrefixList;
        this.tagStatus = $.tagStatus;
    }

    public static Builder builder() {
        return new Builder();
    }
    public static Builder builder(LifecyclePolicyRuleArgs defaults) {
        return new Builder(defaults);
    }

    public static final class Builder {
        private LifecyclePolicyRuleArgs $;

        public Builder() {
            $ = new LifecyclePolicyRuleArgs();
        }

        public Builder(LifecyclePolicyRuleArgs defaults) {
            $ = new LifecyclePolicyRuleArgs(Objects.requireNonNull(defaults));
        }

        /**
         * @param description Describes the purpose of a rule within a lifecycle policy.
         * 
         * @return builder
         * 
         */
        public Builder description(@Nullable Output description) {
            $.description = description;
            return this;
        }

        /**
         * @param description Describes the purpose of a rule within a lifecycle policy.
         * 
         * @return builder
         * 
         */
        public Builder description(String description) {
            return description(Output.of(description));
        }

        /**
         * @param maximumAgeLimit The maximum age limit (in days) for your images. Either [maximumNumberOfImages] or [maximumAgeLimit] must be provided.
         * 
         * @return builder
         * 
         */
        public Builder maximumAgeLimit(@Nullable Output maximumAgeLimit) {
            $.maximumAgeLimit = maximumAgeLimit;
            return this;
        }

        /**
         * @param maximumAgeLimit The maximum age limit (in days) for your images. Either [maximumNumberOfImages] or [maximumAgeLimit] must be provided.
         * 
         * @return builder
         * 
         */
        public Builder maximumAgeLimit(Double maximumAgeLimit) {
            return maximumAgeLimit(Output.of(maximumAgeLimit));
        }

        /**
         * @param maximumNumberOfImages The maximum number of images that you want to retain in your repository. Either [maximumNumberOfImages] or [maximumAgeLimit] must be provided.
         * 
         * @return builder
         * 
         */
        public Builder maximumNumberOfImages(@Nullable Output maximumNumberOfImages) {
            $.maximumNumberOfImages = maximumNumberOfImages;
            return this;
        }

        /**
         * @param maximumNumberOfImages The maximum number of images that you want to retain in your repository. Either [maximumNumberOfImages] or [maximumAgeLimit] must be provided.
         * 
         * @return builder
         * 
         */
        public Builder maximumNumberOfImages(Double maximumNumberOfImages) {
            return maximumNumberOfImages(Output.of(maximumNumberOfImages));
        }

        /**
         * @param tagPrefixList A list of image tag prefixes on which to take action with your lifecycle policy. Only used if you specified "tagStatus": "tagged". For example, if your images are tagged as prod, prod1, prod2, and so on, you would use the tag prefix prod to specify all of them. If you specify multiple tags, only the images with all specified tags are selected.
         * 
         * @return builder
         * 
         */
        public Builder tagPrefixList(@Nullable Output> tagPrefixList) {
            $.tagPrefixList = tagPrefixList;
            return this;
        }

        /**
         * @param tagPrefixList A list of image tag prefixes on which to take action with your lifecycle policy. Only used if you specified "tagStatus": "tagged". For example, if your images are tagged as prod, prod1, prod2, and so on, you would use the tag prefix prod to specify all of them. If you specify multiple tags, only the images with all specified tags are selected.
         * 
         * @return builder
         * 
         */
        public Builder tagPrefixList(List tagPrefixList) {
            return tagPrefixList(Output.of(tagPrefixList));
        }

        /**
         * @param tagPrefixList A list of image tag prefixes on which to take action with your lifecycle policy. Only used if you specified "tagStatus": "tagged". For example, if your images are tagged as prod, prod1, prod2, and so on, you would use the tag prefix prod to specify all of them. If you specify multiple tags, only the images with all specified tags are selected.
         * 
         * @return builder
         * 
         */
        public Builder tagPrefixList(String... tagPrefixList) {
            return tagPrefixList(List.of(tagPrefixList));
        }

        /**
         * @param tagStatus Determines whether the lifecycle policy rule that you are adding specifies a tag for an image. Acceptable options are tagged, untagged, or any. If you specify any, then all images have the rule evaluated against them. If you specify tagged, then you must also specify a tagPrefixList value. If you specify untagged, then you must omit tagPrefixList.
         * 
         * @return builder
         * 
         */
        public Builder tagStatus(Output tagStatus) {
            $.tagStatus = tagStatus;
            return this;
        }

        /**
         * @param tagStatus Determines whether the lifecycle policy rule that you are adding specifies a tag for an image. Acceptable options are tagged, untagged, or any. If you specify any, then all images have the rule evaluated against them. If you specify tagged, then you must also specify a tagPrefixList value. If you specify untagged, then you must omit tagPrefixList.
         * 
         * @return builder
         * 
         */
        public Builder tagStatus(LifecycleTagStatus tagStatus) {
            return tagStatus(Output.of(tagStatus));
        }

        public LifecyclePolicyRuleArgs build() {
            $.tagStatus = Objects.requireNonNull($.tagStatus, "expected parameter 'tagStatus' to be non-null");
            return $;
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy