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

com.pulumi.digitalocean.KubernetesNodePoolArgs Maven / Gradle / Ivy

There is a newer version: 4.35.0
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.digitalocean;

import com.pulumi.core.Either;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import com.pulumi.digitalocean.enums.DropletSlug;
import com.pulumi.digitalocean.inputs.KubernetesNodePoolTaintArgs;
import com.pulumi.exceptions.MissingRequiredPropertyException;
import java.lang.Boolean;
import java.lang.Integer;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


public final class KubernetesNodePoolArgs extends com.pulumi.resources.ResourceArgs {

    public static final KubernetesNodePoolArgs Empty = new KubernetesNodePoolArgs();

    /**
     * Enable auto-scaling of the number of nodes in the node pool within the given min/max range.
     * 
     */
    @Import(name="autoScale")
    private @Nullable Output autoScale;

    /**
     * @return Enable auto-scaling of the number of nodes in the node pool within the given min/max range.
     * 
     */
    public Optional> autoScale() {
        return Optional.ofNullable(this.autoScale);
    }

    /**
     * The ID of the Kubernetes cluster to which the node pool is associated.
     * 
     */
    @Import(name="clusterId", required=true)
    private Output clusterId;

    /**
     * @return The ID of the Kubernetes cluster to which the node pool is associated.
     * 
     */
    public Output clusterId() {
        return this.clusterId;
    }

    /**
     * A map of key/value pairs to apply to nodes in the pool. The labels are exposed in the Kubernetes API as labels in the metadata of the corresponding [Node resources](https://kubernetes.io/docs/concepts/architecture/nodes/).
     * 
     */
    @Import(name="labels")
    private @Nullable Output> labels;

    /**
     * @return A map of key/value pairs to apply to nodes in the pool. The labels are exposed in the Kubernetes API as labels in the metadata of the corresponding [Node resources](https://kubernetes.io/docs/concepts/architecture/nodes/).
     * 
     */
    public Optional>> labels() {
        return Optional.ofNullable(this.labels);
    }

    /**
     * If auto-scaling is enabled, this represents the maximum number of nodes that the node pool can be scaled up to.
     * 
     */
    @Import(name="maxNodes")
    private @Nullable Output maxNodes;

    /**
     * @return If auto-scaling is enabled, this represents the maximum number of nodes that the node pool can be scaled up to.
     * 
     */
    public Optional> maxNodes() {
        return Optional.ofNullable(this.maxNodes);
    }

    /**
     * If auto-scaling is enabled, this represents the minimum number of nodes that the node pool can be scaled down to.
     * 
     */
    @Import(name="minNodes")
    private @Nullable Output minNodes;

    /**
     * @return If auto-scaling is enabled, this represents the minimum number of nodes that the node pool can be scaled down to.
     * 
     */
    public Optional> minNodes() {
        return Optional.ofNullable(this.minNodes);
    }

    /**
     * A name for the node pool.
     * 
     */
    @Import(name="name")
    private @Nullable Output name;

    /**
     * @return A name for the node pool.
     * 
     */
    public Optional> name() {
        return Optional.ofNullable(this.name);
    }

    /**
     * The number of Droplet instances in the node pool. If auto-scaling is enabled, this should only be set if the desired result is to explicitly reset the number of nodes to this value. If auto-scaling is enabled, and the node count is outside of the given min/max range, it will use the min nodes value.
     * 
     */
    @Import(name="nodeCount")
    private @Nullable Output nodeCount;

    /**
     * @return The number of Droplet instances in the node pool. If auto-scaling is enabled, this should only be set if the desired result is to explicitly reset the number of nodes to this value. If auto-scaling is enabled, and the node count is outside of the given min/max range, it will use the min nodes value.
     * 
     */
    public Optional> nodeCount() {
        return Optional.ofNullable(this.nodeCount);
    }

    /**
     * The slug identifier for the type of Droplet to be used as workers in the node pool.
     * 
     */
    @Import(name="size", required=true)
    private Output> size;

    /**
     * @return The slug identifier for the type of Droplet to be used as workers in the node pool.
     * 
     */
    public Output> size() {
        return this.size;
    }

    /**
     * A list of tag names to be applied to the Kubernetes cluster.
     * 
     */
    @Import(name="tags")
    private @Nullable Output> tags;

    /**
     * @return A list of tag names to be applied to the Kubernetes cluster.
     * 
     */
    public Optional>> tags() {
        return Optional.ofNullable(this.tags);
    }

    /**
     * A list of taints applied to all nodes in the pool.
     * 
     * This resource supports customized create timeouts. The default timeout is 30 minutes.
     * 
     */
    @Import(name="taints")
    private @Nullable Output> taints;

    /**
     * @return A list of taints applied to all nodes in the pool.
     * 
     * This resource supports customized create timeouts. The default timeout is 30 minutes.
     * 
     */
    public Optional>> taints() {
        return Optional.ofNullable(this.taints);
    }

    private KubernetesNodePoolArgs() {}

    private KubernetesNodePoolArgs(KubernetesNodePoolArgs $) {
        this.autoScale = $.autoScale;
        this.clusterId = $.clusterId;
        this.labels = $.labels;
        this.maxNodes = $.maxNodes;
        this.minNodes = $.minNodes;
        this.name = $.name;
        this.nodeCount = $.nodeCount;
        this.size = $.size;
        this.tags = $.tags;
        this.taints = $.taints;
    }

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

    public static final class Builder {
        private KubernetesNodePoolArgs $;

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

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

        /**
         * @param autoScale Enable auto-scaling of the number of nodes in the node pool within the given min/max range.
         * 
         * @return builder
         * 
         */
        public Builder autoScale(@Nullable Output autoScale) {
            $.autoScale = autoScale;
            return this;
        }

        /**
         * @param autoScale Enable auto-scaling of the number of nodes in the node pool within the given min/max range.
         * 
         * @return builder
         * 
         */
        public Builder autoScale(Boolean autoScale) {
            return autoScale(Output.of(autoScale));
        }

        /**
         * @param clusterId The ID of the Kubernetes cluster to which the node pool is associated.
         * 
         * @return builder
         * 
         */
        public Builder clusterId(Output clusterId) {
            $.clusterId = clusterId;
            return this;
        }

        /**
         * @param clusterId The ID of the Kubernetes cluster to which the node pool is associated.
         * 
         * @return builder
         * 
         */
        public Builder clusterId(String clusterId) {
            return clusterId(Output.of(clusterId));
        }

        /**
         * @param labels A map of key/value pairs to apply to nodes in the pool. The labels are exposed in the Kubernetes API as labels in the metadata of the corresponding [Node resources](https://kubernetes.io/docs/concepts/architecture/nodes/).
         * 
         * @return builder
         * 
         */
        public Builder labels(@Nullable Output> labels) {
            $.labels = labels;
            return this;
        }

        /**
         * @param labels A map of key/value pairs to apply to nodes in the pool. The labels are exposed in the Kubernetes API as labels in the metadata of the corresponding [Node resources](https://kubernetes.io/docs/concepts/architecture/nodes/).
         * 
         * @return builder
         * 
         */
        public Builder labels(Map labels) {
            return labels(Output.of(labels));
        }

        /**
         * @param maxNodes If auto-scaling is enabled, this represents the maximum number of nodes that the node pool can be scaled up to.
         * 
         * @return builder
         * 
         */
        public Builder maxNodes(@Nullable Output maxNodes) {
            $.maxNodes = maxNodes;
            return this;
        }

        /**
         * @param maxNodes If auto-scaling is enabled, this represents the maximum number of nodes that the node pool can be scaled up to.
         * 
         * @return builder
         * 
         */
        public Builder maxNodes(Integer maxNodes) {
            return maxNodes(Output.of(maxNodes));
        }

        /**
         * @param minNodes If auto-scaling is enabled, this represents the minimum number of nodes that the node pool can be scaled down to.
         * 
         * @return builder
         * 
         */
        public Builder minNodes(@Nullable Output minNodes) {
            $.minNodes = minNodes;
            return this;
        }

        /**
         * @param minNodes If auto-scaling is enabled, this represents the minimum number of nodes that the node pool can be scaled down to.
         * 
         * @return builder
         * 
         */
        public Builder minNodes(Integer minNodes) {
            return minNodes(Output.of(minNodes));
        }

        /**
         * @param name A name for the node pool.
         * 
         * @return builder
         * 
         */
        public Builder name(@Nullable Output name) {
            $.name = name;
            return this;
        }

        /**
         * @param name A name for the node pool.
         * 
         * @return builder
         * 
         */
        public Builder name(String name) {
            return name(Output.of(name));
        }

        /**
         * @param nodeCount The number of Droplet instances in the node pool. If auto-scaling is enabled, this should only be set if the desired result is to explicitly reset the number of nodes to this value. If auto-scaling is enabled, and the node count is outside of the given min/max range, it will use the min nodes value.
         * 
         * @return builder
         * 
         */
        public Builder nodeCount(@Nullable Output nodeCount) {
            $.nodeCount = nodeCount;
            return this;
        }

        /**
         * @param nodeCount The number of Droplet instances in the node pool. If auto-scaling is enabled, this should only be set if the desired result is to explicitly reset the number of nodes to this value. If auto-scaling is enabled, and the node count is outside of the given min/max range, it will use the min nodes value.
         * 
         * @return builder
         * 
         */
        public Builder nodeCount(Integer nodeCount) {
            return nodeCount(Output.of(nodeCount));
        }

        /**
         * @param size The slug identifier for the type of Droplet to be used as workers in the node pool.
         * 
         * @return builder
         * 
         */
        public Builder size(Output> size) {
            $.size = size;
            return this;
        }

        /**
         * @param size The slug identifier for the type of Droplet to be used as workers in the node pool.
         * 
         * @return builder
         * 
         */
        public Builder size(Either size) {
            return size(Output.of(size));
        }

        /**
         * @param size The slug identifier for the type of Droplet to be used as workers in the node pool.
         * 
         * @return builder
         * 
         */
        public Builder size(String size) {
            return size(Either.ofLeft(size));
        }

        /**
         * @param size The slug identifier for the type of Droplet to be used as workers in the node pool.
         * 
         * @return builder
         * 
         */
        public Builder size(DropletSlug size) {
            return size(Either.ofRight(size));
        }

        /**
         * @param tags A list of tag names to be applied to the Kubernetes cluster.
         * 
         * @return builder
         * 
         */
        public Builder tags(@Nullable Output> tags) {
            $.tags = tags;
            return this;
        }

        /**
         * @param tags A list of tag names to be applied to the Kubernetes cluster.
         * 
         * @return builder
         * 
         */
        public Builder tags(List tags) {
            return tags(Output.of(tags));
        }

        /**
         * @param tags A list of tag names to be applied to the Kubernetes cluster.
         * 
         * @return builder
         * 
         */
        public Builder tags(String... tags) {
            return tags(List.of(tags));
        }

        /**
         * @param taints A list of taints applied to all nodes in the pool.
         * 
         * This resource supports customized create timeouts. The default timeout is 30 minutes.
         * 
         * @return builder
         * 
         */
        public Builder taints(@Nullable Output> taints) {
            $.taints = taints;
            return this;
        }

        /**
         * @param taints A list of taints applied to all nodes in the pool.
         * 
         * This resource supports customized create timeouts. The default timeout is 30 minutes.
         * 
         * @return builder
         * 
         */
        public Builder taints(List taints) {
            return taints(Output.of(taints));
        }

        /**
         * @param taints A list of taints applied to all nodes in the pool.
         * 
         * This resource supports customized create timeouts. The default timeout is 30 minutes.
         * 
         * @return builder
         * 
         */
        public Builder taints(KubernetesNodePoolTaintArgs... taints) {
            return taints(List.of(taints));
        }

        public KubernetesNodePoolArgs build() {
            if ($.clusterId == null) {
                throw new MissingRequiredPropertyException("KubernetesNodePoolArgs", "clusterId");
            }
            if ($.size == null) {
                throw new MissingRequiredPropertyException("KubernetesNodePoolArgs", "size");
            }
            return $;
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy