ReservedInstanceArgs

data class ReservedInstanceArgs(val autoRenewPeriod: Output<Int>? = null, val description: Output<String>? = null, val instanceAmount: Output<Int>? = null, val instanceType: Output<String>? = null, val name: Output<String>? = null, val offeringType: Output<String>? = null, val period: Output<Int>? = null, val periodUnit: Output<String>? = null, val platform: Output<String>? = null, val renewalStatus: Output<String>? = null, val reservedInstanceName: Output<String>? = null, val resourceGroupId: Output<String>? = null, val scope: Output<String>? = null, val tags: Output<Map<String, Any>>? = null, val zoneId: Output<String>? = null) : ConvertibleToJava<ReservedInstanceArgs>

Provides an Reserved Instance resource.

NOTE: Available in 1.65.0+

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.ecs.EcsFunctions;
import com.pulumi.alicloud.ecs.inputs.GetInstanceTypesArgs;
import com.pulumi.alicloud.ecs.ReservedInstance;
import com.pulumi.alicloud.ecs.ReservedInstanceArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var defaultInstanceTypes = EcsFunctions.getInstanceTypes(GetInstanceTypesArgs.builder()
.instanceTypeFamily("ecs.g6")
.build());
var defaultReservedInstance = new ReservedInstance("defaultReservedInstance", ReservedInstanceArgs.builder()
.instanceType(defaultInstanceTypes.applyValue(getInstanceTypesResult -> getInstanceTypesResult.instanceTypes()[0].id()))
.instanceAmount("1")
.periodUnit("Month")
.offeringType("All Upfront")
.reservedInstanceName("terraform-example")
.description("ReservedInstance")
.zoneId(defaultInstanceTypes.applyValue(getInstanceTypesResult -> getInstanceTypesResult.instanceTypes()[0].availabilityZones()[0]))
.scope("Zone")
.build());
}
}

Import

reservedInstance can be imported using id, e.g.

$ pulumi import alicloud:ecs/reservedInstance:ReservedInstance default ecsri-uf6df4xm0h3licit****

Constructors

Link copied to clipboard
fun ReservedInstanceArgs(autoRenewPeriod: Output<Int>? = null, description: Output<String>? = null, instanceAmount: Output<Int>? = null, instanceType: Output<String>? = null, name: Output<String>? = null, offeringType: Output<String>? = null, period: Output<Int>? = null, periodUnit: Output<String>? = null, platform: Output<String>? = null, renewalStatus: Output<String>? = null, reservedInstanceName: Output<String>? = null, resourceGroupId: Output<String>? = null, scope: Output<String>? = null, tags: Output<Map<String, Any>>? = null, zoneId: Output<String>? = null)

Functions

Link copied to clipboard
open override fun toJava(): ReservedInstanceArgs

Properties

Link copied to clipboard
val autoRenewPeriod: Output<Int>? = null

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

Link copied to clipboard
val description: Output<String>? = null

Description of the RI. 2 to 256 English or Chinese characters. It cannot start with http:// or https://.

Link copied to clipboard
val instanceAmount: Output<Int>? = null

Number of instances allocated to an RI (An RI is a coupon that includes one or more allocated instances.).

Link copied to clipboard
val instanceType: Output<String>? = null

Instance type of the RI. For more information, see Instance type families.

Link copied to clipboard
val name: Output<String>? = null

Field name has been deprecated from provider version 1.194.0. New field reserved_instance_name instead.

Link copied to clipboard
val offeringType: Output<String>? = null

Payment type of the RI. Default value: All Upfront. Valid values:

Link copied to clipboard
val period: Output<Int>? = null

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.

Link copied to clipboard
val periodUnit: Output<String>? = null

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.

Link copied to clipboard
val platform: Output<String>? = null

The operating system type of the image used by the instance. Optional values: Windows, Linux. Default is Linux.

Link copied to clipboard
val renewalStatus: Output<String>? = null

Automatic renewal status. Valid values: AutoRenewal,Normal.

Link copied to clipboard
val reservedInstanceName: Output<String>? = null

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://.

Link copied to clipboard
val resourceGroupId: Output<String>? = null

Resource group ID.

Link copied to clipboard
val scope: Output<String>? = null

Scope of the RI. Optional values: Region: region-level, Zone: zone-level. Default is Region.

Link copied to clipboard
val tags: Output<Map<String, Any>>? = null

A mapping of tags to assign to the resource.

Link copied to clipboard
val zoneId: Output<String>? = null

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.