ReservedInstance

class ReservedInstance : KotlinCustomResource

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****

Properties

Link copied to clipboard

Indicates the sharing status of the reserved instance when the AllocationType parameter is set to Shared. Valid values: allocated: The reserved instance is allocated to another account. beAllocated: The reserved instance is allocated by another account.

Link copied to clipboard
val autoRenewPeriod: Output<Int>

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 createTime: Output<String>

The time when the reserved instance was created.

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

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

Link copied to clipboard
val expiredTime: Output<String>

The time when the reserved instance expires.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val instanceAmount: Output<Int>

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>

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

Link copied to clipboard
val name: Output<String>

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>

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

Link copied to clipboard

Details about the lock status of the reserved instance.

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

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>?

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>

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

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val renewalStatus: Output<String>

Automatic renewal status. Valid values: AutoRenewal,Normal.

Link copied to clipboard

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>

Resource group ID.

Link copied to clipboard
val scope: Output<String>

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

Link copied to clipboard
val startTime: Output<String>

The time when the reserved instance took effect.

Link copied to clipboard
val status: Output<String>

The status of the reserved instance.

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

A mapping of tags to assign to the resource.

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

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.