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

com.pulumi.alicloud.ecs.ReservedInstanceArgs Maven / Gradle / Ivy

There is a newer version: 3.63.0-alpha.1727424957
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.alicloud.ecs;

import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import com.pulumi.exceptions.MissingRequiredPropertyException;
import java.lang.Integer;
import java.lang.String;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


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

    public static final ReservedInstanceArgs Empty = new ReservedInstanceArgs();

    /**
     * The auto-renewal term of the reserved instance. This parameter takes effect only when AutoRenew is set to true. Valid values: 1, 12, 36, and 60. Default value when `period_unit` is set to Month: 1 Default value when `period_unit` is set to Year: 12
     * 
     */
    @Import(name="autoRenewPeriod")
    private @Nullable Output autoRenewPeriod;

    /**
     * @return The auto-renewal term of the reserved instance. This parameter takes effect only when AutoRenew is set to true. Valid values: 1, 12, 36, and 60. Default value when `period_unit` is set to Month: 1 Default value when `period_unit` is set to Year: 12
     * 
     */
    public Optional> autoRenewPeriod() {
        return Optional.ofNullable(this.autoRenewPeriod);
    }

    /**
     * Description of the RI. 2 to 256 English or Chinese characters. It cannot start with `http://` or `https://`.
     * 
     */
    @Import(name="description")
    private @Nullable Output description;

    /**
     * @return Description of the RI. 2 to 256 English or Chinese characters. It cannot start with `http://` or `https://`.
     * 
     */
    public Optional> description() {
        return Optional.ofNullable(this.description);
    }

    /**
     * Number of instances allocated to an RI (An RI is a coupon that includes one or more allocated instances.).
     * 
     */
    @Import(name="instanceAmount")
    private @Nullable Output instanceAmount;

    /**
     * @return Number of instances allocated to an RI (An RI is a coupon that includes one or more allocated instances.).
     * 
     */
    public Optional> instanceAmount() {
        return Optional.ofNullable(this.instanceAmount);
    }

    /**
     * Instance type of the RI. For more information, see [Instance type families](https://www.alibabacloud.com/help/doc-detail/25378.html).
     * 
     */
    @Import(name="instanceType", required=true)
    private Output instanceType;

    /**
     * @return Instance type of the RI. For more information, see [Instance type families](https://www.alibabacloud.com/help/doc-detail/25378.html).
     * 
     */
    public Output instanceType() {
        return this.instanceType;
    }

    /**
     * Field `name` has been deprecated from provider version 1.194.0. New field `reserved_instance_name` instead.
     * 
     * @deprecated
     * Field 'name' has been deprecated from provider version 1.194.0. New field 'reserved_instance_name' instead.
     * 
     */
    @Deprecated /* Field 'name' has been deprecated from provider version 1.194.0. New field 'reserved_instance_name' instead. */
    @Import(name="name")
    private @Nullable Output name;

    /**
     * @return Field `name` has been deprecated from provider version 1.194.0. New field `reserved_instance_name` instead.
     * 
     * @deprecated
     * Field 'name' has been deprecated from provider version 1.194.0. New field 'reserved_instance_name' instead.
     * 
     */
    @Deprecated /* Field 'name' has been deprecated from provider version 1.194.0. New field 'reserved_instance_name' instead. */
    public Optional> name() {
        return Optional.ofNullable(this.name);
    }

    /**
     * Payment type of the RI. Default value: `All Upfront`. Valid values:
     * - `No Upfront`: No upfront payment.
     * - `Partial Upfront`: A portion of upfront payment.
     * - `All Upfront`: Full upfront payment.
     * 
     */
    @Import(name="offeringType")
    private @Nullable Output offeringType;

    /**
     * @return Payment type of the RI. Default value: `All Upfront`. Valid values:
     * - `No Upfront`: No upfront payment.
     * - `Partial Upfront`: A portion of upfront payment.
     * - `All Upfront`: Full upfront payment.
     * 
     */
    public Optional> offeringType() {
        return Optional.ofNullable(this.offeringType);
    }

    /**
     * The validity period of the reserved instance. Default value: `1`. **NOTE:** From version 1.183.0, `period` can be set to `5`, when `period_unit` is `Year`.
     * - When `period_unit` is `Year`, Valid values: `1`, `3`, `5`.
     * - When `period_unit` is `Month`, Valid values: `1`.
     * 
     */
    @Import(name="period")
    private @Nullable Output period;

    /**
     * @return The validity period of the reserved instance. Default value: `1`. **NOTE:** From version 1.183.0, `period` can be set to `5`, when `period_unit` is `Year`.
     * - When `period_unit` is `Year`, Valid values: `1`, `3`, `5`.
     * - When `period_unit` is `Month`, Valid values: `1`.
     * 
     */
    public Optional> period() {
        return Optional.ofNullable(this.period);
    }

    /**
     * The unit of the validity period of the reserved instance. Valid value: `Month`, `Year`. Default value: `Year`. **NOTE:** From version 1.183.0, `period_unit` can be set to `Month`.
     * 
     */
    @Import(name="periodUnit")
    private @Nullable Output periodUnit;

    /**
     * @return The unit of the validity period of the reserved instance. Valid value: `Month`, `Year`. Default value: `Year`. **NOTE:** From version 1.183.0, `period_unit` can be set to `Month`.
     * 
     */
    public Optional> periodUnit() {
        return Optional.ofNullable(this.periodUnit);
    }

    /**
     * The operating system type of the image used by the instance. Optional values: `Windows`, `Linux`. Default is `Linux`.
     * 
     */
    @Import(name="platform")
    private @Nullable Output platform;

    /**
     * @return The operating system type of the image used by the instance. Optional values: `Windows`, `Linux`. Default is `Linux`.
     * 
     */
    public Optional> platform() {
        return Optional.ofNullable(this.platform);
    }

    /**
     * Automatic renewal status. Valid values: `AutoRenewal`,`Normal`.
     * 
     */
    @Import(name="renewalStatus")
    private @Nullable Output renewalStatus;

    /**
     * @return Automatic renewal status. Valid values: `AutoRenewal`,`Normal`.
     * 
     */
    public Optional> renewalStatus() {
        return Optional.ofNullable(this.renewalStatus);
    }

    /**
     * Name of the RI. The name must be a string of 2 to 128 characters in length and can contain letters, numbers, colons (:), underscores (_), and hyphens. It must start with a letter. It cannot start with http:// or https://.
     * 
     */
    @Import(name="reservedInstanceName")
    private @Nullable Output reservedInstanceName;

    /**
     * @return Name of the RI. The name must be a string of 2 to 128 characters in length and can contain letters, numbers, colons (:), underscores (_), and hyphens. It must start with a letter. It cannot start with http:// or https://.
     * 
     */
    public Optional> reservedInstanceName() {
        return Optional.ofNullable(this.reservedInstanceName);
    }

    /**
     * Resource group ID.
     * 
     */
    @Import(name="resourceGroupId")
    private @Nullable Output resourceGroupId;

    /**
     * @return Resource group ID.
     * 
     */
    public Optional> resourceGroupId() {
        return Optional.ofNullable(this.resourceGroupId);
    }

    /**
     * Scope of the RI. Optional values: `Region`: region-level, `Zone`: zone-level. Default is `Region`.
     * 
     */
    @Import(name="scope")
    private @Nullable Output scope;

    /**
     * @return Scope of the RI. Optional values: `Region`: region-level, `Zone`: zone-level. Default is `Region`.
     * 
     */
    public Optional> scope() {
        return Optional.ofNullable(this.scope);
    }

    /**
     * A mapping of tags to assign to the resource.
     * 
     */
    @Import(name="tags")
    private @Nullable Output> tags;

    /**
     * @return A mapping of tags to assign to the resource.
     * 
     */
    public Optional>> tags() {
        return Optional.ofNullable(this.tags);
    }

    /**
     * ID of the zone to which the RI belongs. When Scope is set to Zone, this parameter is required. For information about the zone list, see [DescribeZones](https://www.alibabacloud.com/help/doc-detail/25610.html).
     * 
     */
    @Import(name="zoneId")
    private @Nullable Output zoneId;

    /**
     * @return ID of the zone to which the RI belongs. When Scope is set to Zone, this parameter is required. For information about the zone list, see [DescribeZones](https://www.alibabacloud.com/help/doc-detail/25610.html).
     * 
     */
    public Optional> zoneId() {
        return Optional.ofNullable(this.zoneId);
    }

    private ReservedInstanceArgs() {}

    private ReservedInstanceArgs(ReservedInstanceArgs $) {
        this.autoRenewPeriod = $.autoRenewPeriod;
        this.description = $.description;
        this.instanceAmount = $.instanceAmount;
        this.instanceType = $.instanceType;
        this.name = $.name;
        this.offeringType = $.offeringType;
        this.period = $.period;
        this.periodUnit = $.periodUnit;
        this.platform = $.platform;
        this.renewalStatus = $.renewalStatus;
        this.reservedInstanceName = $.reservedInstanceName;
        this.resourceGroupId = $.resourceGroupId;
        this.scope = $.scope;
        this.tags = $.tags;
        this.zoneId = $.zoneId;
    }

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

    public static final class Builder {
        private ReservedInstanceArgs $;

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

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

        /**
         * @param autoRenewPeriod The auto-renewal term of the reserved instance. This parameter takes effect only when AutoRenew is set to true. Valid values: 1, 12, 36, and 60. Default value when `period_unit` is set to Month: 1 Default value when `period_unit` is set to Year: 12
         * 
         * @return builder
         * 
         */
        public Builder autoRenewPeriod(@Nullable Output autoRenewPeriod) {
            $.autoRenewPeriod = autoRenewPeriod;
            return this;
        }

        /**
         * @param autoRenewPeriod The auto-renewal term of the reserved instance. This parameter takes effect only when AutoRenew is set to true. Valid values: 1, 12, 36, and 60. Default value when `period_unit` is set to Month: 1 Default value when `period_unit` is set to Year: 12
         * 
         * @return builder
         * 
         */
        public Builder autoRenewPeriod(Integer autoRenewPeriod) {
            return autoRenewPeriod(Output.of(autoRenewPeriod));
        }

        /**
         * @param description Description of the RI. 2 to 256 English or Chinese characters. It cannot start with `http://` or `https://`.
         * 
         * @return builder
         * 
         */
        public Builder description(@Nullable Output description) {
            $.description = description;
            return this;
        }

        /**
         * @param description Description of the RI. 2 to 256 English or Chinese characters. It cannot start with `http://` or `https://`.
         * 
         * @return builder
         * 
         */
        public Builder description(String description) {
            return description(Output.of(description));
        }

        /**
         * @param instanceAmount Number of instances allocated to an RI (An RI is a coupon that includes one or more allocated instances.).
         * 
         * @return builder
         * 
         */
        public Builder instanceAmount(@Nullable Output instanceAmount) {
            $.instanceAmount = instanceAmount;
            return this;
        }

        /**
         * @param instanceAmount Number of instances allocated to an RI (An RI is a coupon that includes one or more allocated instances.).
         * 
         * @return builder
         * 
         */
        public Builder instanceAmount(Integer instanceAmount) {
            return instanceAmount(Output.of(instanceAmount));
        }

        /**
         * @param instanceType Instance type of the RI. For more information, see [Instance type families](https://www.alibabacloud.com/help/doc-detail/25378.html).
         * 
         * @return builder
         * 
         */
        public Builder instanceType(Output instanceType) {
            $.instanceType = instanceType;
            return this;
        }

        /**
         * @param instanceType Instance type of the RI. For more information, see [Instance type families](https://www.alibabacloud.com/help/doc-detail/25378.html).
         * 
         * @return builder
         * 
         */
        public Builder instanceType(String instanceType) {
            return instanceType(Output.of(instanceType));
        }

        /**
         * @param name Field `name` has been deprecated from provider version 1.194.0. New field `reserved_instance_name` instead.
         * 
         * @return builder
         * 
         * @deprecated
         * Field 'name' has been deprecated from provider version 1.194.0. New field 'reserved_instance_name' instead.
         * 
         */
        @Deprecated /* Field 'name' has been deprecated from provider version 1.194.0. New field 'reserved_instance_name' instead. */
        public Builder name(@Nullable Output name) {
            $.name = name;
            return this;
        }

        /**
         * @param name Field `name` has been deprecated from provider version 1.194.0. New field `reserved_instance_name` instead.
         * 
         * @return builder
         * 
         * @deprecated
         * Field 'name' has been deprecated from provider version 1.194.0. New field 'reserved_instance_name' instead.
         * 
         */
        @Deprecated /* Field 'name' has been deprecated from provider version 1.194.0. New field 'reserved_instance_name' instead. */
        public Builder name(String name) {
            return name(Output.of(name));
        }

        /**
         * @param offeringType Payment type of the RI. Default value: `All Upfront`. Valid values:
         * - `No Upfront`: No upfront payment.
         * - `Partial Upfront`: A portion of upfront payment.
         * - `All Upfront`: Full upfront payment.
         * 
         * @return builder
         * 
         */
        public Builder offeringType(@Nullable Output offeringType) {
            $.offeringType = offeringType;
            return this;
        }

        /**
         * @param offeringType Payment type of the RI. Default value: `All Upfront`. Valid values:
         * - `No Upfront`: No upfront payment.
         * - `Partial Upfront`: A portion of upfront payment.
         * - `All Upfront`: Full upfront payment.
         * 
         * @return builder
         * 
         */
        public Builder offeringType(String offeringType) {
            return offeringType(Output.of(offeringType));
        }

        /**
         * @param period The validity period of the reserved instance. Default value: `1`. **NOTE:** From version 1.183.0, `period` can be set to `5`, when `period_unit` is `Year`.
         * - When `period_unit` is `Year`, Valid values: `1`, `3`, `5`.
         * - When `period_unit` is `Month`, Valid values: `1`.
         * 
         * @return builder
         * 
         */
        public Builder period(@Nullable Output period) {
            $.period = period;
            return this;
        }

        /**
         * @param period The validity period of the reserved instance. Default value: `1`. **NOTE:** From version 1.183.0, `period` can be set to `5`, when `period_unit` is `Year`.
         * - When `period_unit` is `Year`, Valid values: `1`, `3`, `5`.
         * - When `period_unit` is `Month`, Valid values: `1`.
         * 
         * @return builder
         * 
         */
        public Builder period(Integer period) {
            return period(Output.of(period));
        }

        /**
         * @param periodUnit The unit of the validity period of the reserved instance. Valid value: `Month`, `Year`. Default value: `Year`. **NOTE:** From version 1.183.0, `period_unit` can be set to `Month`.
         * 
         * @return builder
         * 
         */
        public Builder periodUnit(@Nullable Output periodUnit) {
            $.periodUnit = periodUnit;
            return this;
        }

        /**
         * @param periodUnit The unit of the validity period of the reserved instance. Valid value: `Month`, `Year`. Default value: `Year`. **NOTE:** From version 1.183.0, `period_unit` can be set to `Month`.
         * 
         * @return builder
         * 
         */
        public Builder periodUnit(String periodUnit) {
            return periodUnit(Output.of(periodUnit));
        }

        /**
         * @param platform The operating system type of the image used by the instance. Optional values: `Windows`, `Linux`. Default is `Linux`.
         * 
         * @return builder
         * 
         */
        public Builder platform(@Nullable Output platform) {
            $.platform = platform;
            return this;
        }

        /**
         * @param platform The operating system type of the image used by the instance. Optional values: `Windows`, `Linux`. Default is `Linux`.
         * 
         * @return builder
         * 
         */
        public Builder platform(String platform) {
            return platform(Output.of(platform));
        }

        /**
         * @param renewalStatus Automatic renewal status. Valid values: `AutoRenewal`,`Normal`.
         * 
         * @return builder
         * 
         */
        public Builder renewalStatus(@Nullable Output renewalStatus) {
            $.renewalStatus = renewalStatus;
            return this;
        }

        /**
         * @param renewalStatus Automatic renewal status. Valid values: `AutoRenewal`,`Normal`.
         * 
         * @return builder
         * 
         */
        public Builder renewalStatus(String renewalStatus) {
            return renewalStatus(Output.of(renewalStatus));
        }

        /**
         * @param reservedInstanceName Name of the RI. The name must be a string of 2 to 128 characters in length and can contain letters, numbers, colons (:), underscores (_), and hyphens. It must start with a letter. It cannot start with http:// or https://.
         * 
         * @return builder
         * 
         */
        public Builder reservedInstanceName(@Nullable Output reservedInstanceName) {
            $.reservedInstanceName = reservedInstanceName;
            return this;
        }

        /**
         * @param reservedInstanceName Name of the RI. The name must be a string of 2 to 128 characters in length and can contain letters, numbers, colons (:), underscores (_), and hyphens. It must start with a letter. It cannot start with http:// or https://.
         * 
         * @return builder
         * 
         */
        public Builder reservedInstanceName(String reservedInstanceName) {
            return reservedInstanceName(Output.of(reservedInstanceName));
        }

        /**
         * @param resourceGroupId Resource group ID.
         * 
         * @return builder
         * 
         */
        public Builder resourceGroupId(@Nullable Output resourceGroupId) {
            $.resourceGroupId = resourceGroupId;
            return this;
        }

        /**
         * @param resourceGroupId Resource group ID.
         * 
         * @return builder
         * 
         */
        public Builder resourceGroupId(String resourceGroupId) {
            return resourceGroupId(Output.of(resourceGroupId));
        }

        /**
         * @param scope Scope of the RI. Optional values: `Region`: region-level, `Zone`: zone-level. Default is `Region`.
         * 
         * @return builder
         * 
         */
        public Builder scope(@Nullable Output scope) {
            $.scope = scope;
            return this;
        }

        /**
         * @param scope Scope of the RI. Optional values: `Region`: region-level, `Zone`: zone-level. Default is `Region`.
         * 
         * @return builder
         * 
         */
        public Builder scope(String scope) {
            return scope(Output.of(scope));
        }

        /**
         * @param tags A mapping of tags to assign to the resource.
         * 
         * @return builder
         * 
         */
        public Builder tags(@Nullable Output> tags) {
            $.tags = tags;
            return this;
        }

        /**
         * @param tags A mapping of tags to assign to the resource.
         * 
         * @return builder
         * 
         */
        public Builder tags(Map tags) {
            return tags(Output.of(tags));
        }

        /**
         * @param zoneId ID of the zone to which the RI belongs. When Scope is set to Zone, this parameter is required. For information about the zone list, see [DescribeZones](https://www.alibabacloud.com/help/doc-detail/25610.html).
         * 
         * @return builder
         * 
         */
        public Builder zoneId(@Nullable Output zoneId) {
            $.zoneId = zoneId;
            return this;
        }

        /**
         * @param zoneId ID of the zone to which the RI belongs. When Scope is set to Zone, this parameter is required. For information about the zone list, see [DescribeZones](https://www.alibabacloud.com/help/doc-detail/25610.html).
         * 
         * @return builder
         * 
         */
        public Builder zoneId(String zoneId) {
            return zoneId(Output.of(zoneId));
        }

        public ReservedInstanceArgs build() {
            if ($.instanceType == null) {
                throw new MissingRequiredPropertyException("ReservedInstanceArgs", "instanceType");
            }
            return $;
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy