alicloud.ecs.ReservedInstance
Explore with Pulumi AI
Provides an Reserved Instance resource.
NOTE: Available in 1.65.0+
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const default = alicloud.ecs.getInstanceTypes({
instanceTypeFamily: "ecs.g6",
});
const defaultReservedInstance = new alicloud.ecs.ReservedInstance("default", {
instanceType: _default.then(_default => _default.instanceTypes?.[0]?.id),
instanceAmount: 1,
periodUnit: "Month",
offeringType: "All Upfront",
reservedInstanceName: "terraform-example",
description: "ReservedInstance",
zoneId: _default.then(_default => _default.instanceTypes?.[0]?.availabilityZones?.[0]),
scope: "Zone",
});
import pulumi
import pulumi_alicloud as alicloud
default = alicloud.ecs.get_instance_types(instance_type_family="ecs.g6")
default_reserved_instance = alicloud.ecs.ReservedInstance("default",
instance_type=default.instance_types[0].id,
instance_amount=1,
period_unit="Month",
offering_type="All Upfront",
reserved_instance_name="terraform-example",
description="ReservedInstance",
zone_id=default.instance_types[0].availability_zones[0],
scope="Zone")
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecs"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_default, err := ecs.GetInstanceTypes(ctx, &ecs.GetInstanceTypesArgs{
InstanceTypeFamily: pulumi.StringRef("ecs.g6"),
}, nil)
if err != nil {
return err
}
_, err = ecs.NewReservedInstance(ctx, "default", &ecs.ReservedInstanceArgs{
InstanceType: pulumi.String(_default.InstanceTypes[0].Id),
InstanceAmount: pulumi.Int(1),
PeriodUnit: pulumi.String("Month"),
OfferingType: pulumi.String("All Upfront"),
ReservedInstanceName: pulumi.String("terraform-example"),
Description: pulumi.String("ReservedInstance"),
ZoneId: pulumi.String(_default.InstanceTypes[0].AvailabilityZones[0]),
Scope: pulumi.String("Zone"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var @default = AliCloud.Ecs.GetInstanceTypes.Invoke(new()
{
InstanceTypeFamily = "ecs.g6",
});
var defaultReservedInstance = new AliCloud.Ecs.ReservedInstance("default", new()
{
InstanceType = @default.Apply(@default => @default.Apply(getInstanceTypesResult => getInstanceTypesResult.InstanceTypes[0]?.Id)),
InstanceAmount = 1,
PeriodUnit = "Month",
OfferingType = "All Upfront",
ReservedInstanceName = "terraform-example",
Description = "ReservedInstance",
ZoneId = @default.Apply(@default => @default.Apply(getInstanceTypesResult => getInstanceTypesResult.InstanceTypes[0]?.AvailabilityZones[0])),
Scope = "Zone",
});
});
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 default = EcsFunctions.getInstanceTypes(GetInstanceTypesArgs.builder()
.instanceTypeFamily("ecs.g6")
.build());
var defaultReservedInstance = new ReservedInstance("defaultReservedInstance", ReservedInstanceArgs.builder()
.instanceType(default_.instanceTypes()[0].id())
.instanceAmount("1")
.periodUnit("Month")
.offeringType("All Upfront")
.reservedInstanceName("terraform-example")
.description("ReservedInstance")
.zoneId(default_.instanceTypes()[0].availabilityZones()[0])
.scope("Zone")
.build());
}
}
resources:
defaultReservedInstance:
type: alicloud:ecs:ReservedInstance
name: default
properties:
instanceType: ${default.instanceTypes[0].id}
instanceAmount: '1'
periodUnit: Month
offeringType: All Upfront
reservedInstanceName: terraform-example
description: ReservedInstance
zoneId: ${default.instanceTypes[0].availabilityZones[0]}
scope: Zone
variables:
default:
fn::invoke:
Function: alicloud:ecs:getInstanceTypes
Arguments:
instanceTypeFamily: ecs.g6
Create ReservedInstance Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ReservedInstance(name: string, args: ReservedInstanceArgs, opts?: CustomResourceOptions);
@overload
def ReservedInstance(resource_name: str,
args: ReservedInstanceArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ReservedInstance(resource_name: str,
opts: Optional[ResourceOptions] = None,
instance_type: Optional[str] = None,
period: Optional[int] = None,
platform: Optional[str] = None,
description: Optional[str] = None,
name: Optional[str] = None,
offering_type: Optional[str] = None,
auto_renew_period: Optional[int] = None,
period_unit: Optional[str] = None,
instance_amount: Optional[int] = None,
renewal_status: Optional[str] = None,
reserved_instance_name: Optional[str] = None,
resource_group_id: Optional[str] = None,
scope: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None,
zone_id: Optional[str] = None)
func NewReservedInstance(ctx *Context, name string, args ReservedInstanceArgs, opts ...ResourceOption) (*ReservedInstance, error)
public ReservedInstance(string name, ReservedInstanceArgs args, CustomResourceOptions? opts = null)
public ReservedInstance(String name, ReservedInstanceArgs args)
public ReservedInstance(String name, ReservedInstanceArgs args, CustomResourceOptions options)
type: alicloud:ecs:ReservedInstance
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args ReservedInstanceArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args ReservedInstanceArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args ReservedInstanceArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ReservedInstanceArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ReservedInstanceArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var reservedInstanceResource = new AliCloud.Ecs.ReservedInstance("reservedInstanceResource", new()
{
InstanceType = "string",
Period = 0,
Platform = "string",
Description = "string",
OfferingType = "string",
AutoRenewPeriod = 0,
PeriodUnit = "string",
InstanceAmount = 0,
RenewalStatus = "string",
ReservedInstanceName = "string",
ResourceGroupId = "string",
Scope = "string",
Tags =
{
{ "string", "string" },
},
ZoneId = "string",
});
example, err := ecs.NewReservedInstance(ctx, "reservedInstanceResource", &ecs.ReservedInstanceArgs{
InstanceType: pulumi.String("string"),
Period: pulumi.Int(0),
Platform: pulumi.String("string"),
Description: pulumi.String("string"),
OfferingType: pulumi.String("string"),
AutoRenewPeriod: pulumi.Int(0),
PeriodUnit: pulumi.String("string"),
InstanceAmount: pulumi.Int(0),
RenewalStatus: pulumi.String("string"),
ReservedInstanceName: pulumi.String("string"),
ResourceGroupId: pulumi.String("string"),
Scope: pulumi.String("string"),
Tags: pulumi.StringMap{
"string": pulumi.String("string"),
},
ZoneId: pulumi.String("string"),
})
var reservedInstanceResource = new ReservedInstance("reservedInstanceResource", ReservedInstanceArgs.builder()
.instanceType("string")
.period(0)
.platform("string")
.description("string")
.offeringType("string")
.autoRenewPeriod(0)
.periodUnit("string")
.instanceAmount(0)
.renewalStatus("string")
.reservedInstanceName("string")
.resourceGroupId("string")
.scope("string")
.tags(Map.of("string", "string"))
.zoneId("string")
.build());
reserved_instance_resource = alicloud.ecs.ReservedInstance("reservedInstanceResource",
instance_type="string",
period=0,
platform="string",
description="string",
offering_type="string",
auto_renew_period=0,
period_unit="string",
instance_amount=0,
renewal_status="string",
reserved_instance_name="string",
resource_group_id="string",
scope="string",
tags={
"string": "string",
},
zone_id="string")
const reservedInstanceResource = new alicloud.ecs.ReservedInstance("reservedInstanceResource", {
instanceType: "string",
period: 0,
platform: "string",
description: "string",
offeringType: "string",
autoRenewPeriod: 0,
periodUnit: "string",
instanceAmount: 0,
renewalStatus: "string",
reservedInstanceName: "string",
resourceGroupId: "string",
scope: "string",
tags: {
string: "string",
},
zoneId: "string",
});
type: alicloud:ecs:ReservedInstance
properties:
autoRenewPeriod: 0
description: string
instanceAmount: 0
instanceType: string
offeringType: string
period: 0
periodUnit: string
platform: string
renewalStatus: string
reservedInstanceName: string
resourceGroupId: string
scope: string
tags:
string: string
zoneId: string
ReservedInstance Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The ReservedInstance resource accepts the following input properties:
- Instance
Type string - Instance type of the RI. For more information, see Instance type families.
- Auto
Renew intPeriod - 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 whenperiod_unit
is set to Year: 12 - Description string
- Description of the RI. 2 to 256 English or Chinese characters. It cannot start with
http://
orhttps://
. - Instance
Amount int - Number of instances allocated to an RI (An RI is a coupon that includes one or more allocated instances.).
- Name string
- Field
name
has been deprecated from provider version 1.194.0. New fieldreserved_instance_name
instead. - Offering
Type string - 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.
- Period int
- The validity period of the reserved instance. Default value:
1
. NOTE: From version 1.183.0,period
can be set to5
, whenperiod_unit
isYear
.- When
period_unit
isYear
, Valid values:1
,3
,5
. - When
period_unit
isMonth
, Valid values:1
.
- When
- Period
Unit 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 toMonth
. - Platform string
- The operating system type of the image used by the instance. Optional values:
Windows
,Linux
. Default isLinux
. - Renewal
Status string - Automatic renewal status. Valid values:
AutoRenewal
,Normal
. - Reserved
Instance stringName - 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://.
- Resource
Group stringId - Resource group ID.
- Scope string
- Scope of the RI. Optional values:
Region
: region-level,Zone
: zone-level. Default isRegion
. - Dictionary<string, string>
- A mapping of tags to assign to the resource.
- Zone
Id 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.
- Instance
Type string - Instance type of the RI. For more information, see Instance type families.
- Auto
Renew intPeriod - 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 whenperiod_unit
is set to Year: 12 - Description string
- Description of the RI. 2 to 256 English or Chinese characters. It cannot start with
http://
orhttps://
. - Instance
Amount int - Number of instances allocated to an RI (An RI is a coupon that includes one or more allocated instances.).
- Name string
- Field
name
has been deprecated from provider version 1.194.0. New fieldreserved_instance_name
instead. - Offering
Type string - 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.
- Period int
- The validity period of the reserved instance. Default value:
1
. NOTE: From version 1.183.0,period
can be set to5
, whenperiod_unit
isYear
.- When
period_unit
isYear
, Valid values:1
,3
,5
. - When
period_unit
isMonth
, Valid values:1
.
- When
- Period
Unit 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 toMonth
. - Platform string
- The operating system type of the image used by the instance. Optional values:
Windows
,Linux
. Default isLinux
. - Renewal
Status string - Automatic renewal status. Valid values:
AutoRenewal
,Normal
. - Reserved
Instance stringName - 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://.
- Resource
Group stringId - Resource group ID.
- Scope string
- Scope of the RI. Optional values:
Region
: region-level,Zone
: zone-level. Default isRegion
. - map[string]string
- A mapping of tags to assign to the resource.
- Zone
Id 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.
- instance
Type String - Instance type of the RI. For more information, see Instance type families.
- auto
Renew IntegerPeriod - 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 whenperiod_unit
is set to Year: 12 - description String
- Description of the RI. 2 to 256 English or Chinese characters. It cannot start with
http://
orhttps://
. - instance
Amount Integer - Number of instances allocated to an RI (An RI is a coupon that includes one or more allocated instances.).
- name String
- Field
name
has been deprecated from provider version 1.194.0. New fieldreserved_instance_name
instead. - offering
Type String - 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.
- period Integer
- The validity period of the reserved instance. Default value:
1
. NOTE: From version 1.183.0,period
can be set to5
, whenperiod_unit
isYear
.- When
period_unit
isYear
, Valid values:1
,3
,5
. - When
period_unit
isMonth
, Valid values:1
.
- When
- period
Unit 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 toMonth
. - platform String
- The operating system type of the image used by the instance. Optional values:
Windows
,Linux
. Default isLinux
. - renewal
Status String - Automatic renewal status. Valid values:
AutoRenewal
,Normal
. - reserved
Instance StringName - 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://.
- resource
Group StringId - Resource group ID.
- scope String
- Scope of the RI. Optional values:
Region
: region-level,Zone
: zone-level. Default isRegion
. - Map<String,String>
- A mapping of tags to assign to the resource.
- zone
Id 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.
- instance
Type string - Instance type of the RI. For more information, see Instance type families.
- auto
Renew numberPeriod - 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 whenperiod_unit
is set to Year: 12 - description string
- Description of the RI. 2 to 256 English or Chinese characters. It cannot start with
http://
orhttps://
. - instance
Amount number - Number of instances allocated to an RI (An RI is a coupon that includes one or more allocated instances.).
- name string
- Field
name
has been deprecated from provider version 1.194.0. New fieldreserved_instance_name
instead. - offering
Type string - 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.
- period number
- The validity period of the reserved instance. Default value:
1
. NOTE: From version 1.183.0,period
can be set to5
, whenperiod_unit
isYear
.- When
period_unit
isYear
, Valid values:1
,3
,5
. - When
period_unit
isMonth
, Valid values:1
.
- When
- period
Unit 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 toMonth
. - platform string
- The operating system type of the image used by the instance. Optional values:
Windows
,Linux
. Default isLinux
. - renewal
Status string - Automatic renewal status. Valid values:
AutoRenewal
,Normal
. - reserved
Instance stringName - 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://.
- resource
Group stringId - Resource group ID.
- scope string
- Scope of the RI. Optional values:
Region
: region-level,Zone
: zone-level. Default isRegion
. - {[key: string]: string}
- A mapping of tags to assign to the resource.
- zone
Id 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.
- instance_
type str - Instance type of the RI. For more information, see Instance type families.
- auto_
renew_ intperiod - 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 whenperiod_unit
is set to Year: 12 - description str
- Description of the RI. 2 to 256 English or Chinese characters. It cannot start with
http://
orhttps://
. - instance_
amount int - Number of instances allocated to an RI (An RI is a coupon that includes one or more allocated instances.).
- name str
- Field
name
has been deprecated from provider version 1.194.0. New fieldreserved_instance_name
instead. - offering_
type str - 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.
- period int
- The validity period of the reserved instance. Default value:
1
. NOTE: From version 1.183.0,period
can be set to5
, whenperiod_unit
isYear
.- When
period_unit
isYear
, Valid values:1
,3
,5
. - When
period_unit
isMonth
, Valid values:1
.
- When
- period_
unit str - 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 toMonth
. - platform str
- The operating system type of the image used by the instance. Optional values:
Windows
,Linux
. Default isLinux
. - renewal_
status str - Automatic renewal status. Valid values:
AutoRenewal
,Normal
. - reserved_
instance_ strname - 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://.
- resource_
group_ strid - Resource group ID.
- scope str
- Scope of the RI. Optional values:
Region
: region-level,Zone
: zone-level. Default isRegion
. - Mapping[str, str]
- A mapping of tags to assign to the resource.
- zone_
id str - 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.
- instance
Type String - Instance type of the RI. For more information, see Instance type families.
- auto
Renew NumberPeriod - 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 whenperiod_unit
is set to Year: 12 - description String
- Description of the RI. 2 to 256 English or Chinese characters. It cannot start with
http://
orhttps://
. - instance
Amount Number - Number of instances allocated to an RI (An RI is a coupon that includes one or more allocated instances.).
- name String
- Field
name
has been deprecated from provider version 1.194.0. New fieldreserved_instance_name
instead. - offering
Type String - 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.
- period Number
- The validity period of the reserved instance. Default value:
1
. NOTE: From version 1.183.0,period
can be set to5
, whenperiod_unit
isYear
.- When
period_unit
isYear
, Valid values:1
,3
,5
. - When
period_unit
isMonth
, Valid values:1
.
- When
- period
Unit 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 toMonth
. - platform String
- The operating system type of the image used by the instance. Optional values:
Windows
,Linux
. Default isLinux
. - renewal
Status String - Automatic renewal status. Valid values:
AutoRenewal
,Normal
. - reserved
Instance StringName - 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://.
- resource
Group StringId - Resource group ID.
- scope String
- Scope of the RI. Optional values:
Region
: region-level,Zone
: zone-level. Default isRegion
. - Map<String>
- A mapping of tags to assign to the resource.
- zone
Id 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.
Outputs
All input properties are implicitly available as output properties. Additionally, the ReservedInstance resource produces the following output properties:
- Allocation
Status string - 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. - Create
Time string - The time when the reserved instance was created.
- Expired
Time string - The time when the reserved instance expires.
- Id string
- The provider-assigned unique ID for this managed resource.
- Operation
Locks List<Pulumi.Ali Cloud. Ecs. Outputs. Reserved Instance Operation Lock> - Details about the lock status of the reserved instance.
- Start
Time string - The time when the reserved instance took effect.
- Status string
- The status of the reserved instance.
- Allocation
Status string - 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. - Create
Time string - The time when the reserved instance was created.
- Expired
Time string - The time when the reserved instance expires.
- Id string
- The provider-assigned unique ID for this managed resource.
- Operation
Locks []ReservedInstance Operation Lock - Details about the lock status of the reserved instance.
- Start
Time string - The time when the reserved instance took effect.
- Status string
- The status of the reserved instance.
- allocation
Status String - 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. - create
Time String - The time when the reserved instance was created.
- expired
Time String - The time when the reserved instance expires.
- id String
- The provider-assigned unique ID for this managed resource.
- operation
Locks List<ReservedInstance Operation Lock> - Details about the lock status of the reserved instance.
- start
Time String - The time when the reserved instance took effect.
- status String
- The status of the reserved instance.
- allocation
Status string - 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. - create
Time string - The time when the reserved instance was created.
- expired
Time string - The time when the reserved instance expires.
- id string
- The provider-assigned unique ID for this managed resource.
- operation
Locks ReservedInstance Operation Lock[] - Details about the lock status of the reserved instance.
- start
Time string - The time when the reserved instance took effect.
- status string
- The status of the reserved instance.
- allocation_
status str - 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. - create_
time str - The time when the reserved instance was created.
- expired_
time str - The time when the reserved instance expires.
- id str
- The provider-assigned unique ID for this managed resource.
- operation_
locks Sequence[ReservedInstance Operation Lock] - Details about the lock status of the reserved instance.
- start_
time str - The time when the reserved instance took effect.
- status str
- The status of the reserved instance.
- allocation
Status String - 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. - create
Time String - The time when the reserved instance was created.
- expired
Time String - The time when the reserved instance expires.
- id String
- The provider-assigned unique ID for this managed resource.
- operation
Locks List<Property Map> - Details about the lock status of the reserved instance.
- start
Time String - The time when the reserved instance took effect.
- status String
- The status of the reserved instance.
Look up Existing ReservedInstance Resource
Get an existing ReservedInstance resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: ReservedInstanceState, opts?: CustomResourceOptions): ReservedInstance
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
allocation_status: Optional[str] = None,
auto_renew_period: Optional[int] = None,
create_time: Optional[str] = None,
description: Optional[str] = None,
expired_time: Optional[str] = None,
instance_amount: Optional[int] = None,
instance_type: Optional[str] = None,
name: Optional[str] = None,
offering_type: Optional[str] = None,
operation_locks: Optional[Sequence[ReservedInstanceOperationLockArgs]] = None,
period: Optional[int] = None,
period_unit: Optional[str] = None,
platform: Optional[str] = None,
renewal_status: Optional[str] = None,
reserved_instance_name: Optional[str] = None,
resource_group_id: Optional[str] = None,
scope: Optional[str] = None,
start_time: Optional[str] = None,
status: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None,
zone_id: Optional[str] = None) -> ReservedInstance
func GetReservedInstance(ctx *Context, name string, id IDInput, state *ReservedInstanceState, opts ...ResourceOption) (*ReservedInstance, error)
public static ReservedInstance Get(string name, Input<string> id, ReservedInstanceState? state, CustomResourceOptions? opts = null)
public static ReservedInstance get(String name, Output<String> id, ReservedInstanceState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Allocation
Status string - 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. - Auto
Renew intPeriod - 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 whenperiod_unit
is set to Year: 12 - Create
Time string - The time when the reserved instance was created.
- Description string
- Description of the RI. 2 to 256 English or Chinese characters. It cannot start with
http://
orhttps://
. - Expired
Time string - The time when the reserved instance expires.
- Instance
Amount int - Number of instances allocated to an RI (An RI is a coupon that includes one or more allocated instances.).
- Instance
Type string - Instance type of the RI. For more information, see Instance type families.
- Name string
- Field
name
has been deprecated from provider version 1.194.0. New fieldreserved_instance_name
instead. - Offering
Type string - 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.
- Operation
Locks List<Pulumi.Ali Cloud. Ecs. Inputs. Reserved Instance Operation Lock> - Details about the lock status of the reserved instance.
- Period int
- The validity period of the reserved instance. Default value:
1
. NOTE: From version 1.183.0,period
can be set to5
, whenperiod_unit
isYear
.- When
period_unit
isYear
, Valid values:1
,3
,5
. - When
period_unit
isMonth
, Valid values:1
.
- When
- Period
Unit 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 toMonth
. - Platform string
- The operating system type of the image used by the instance. Optional values:
Windows
,Linux
. Default isLinux
. - Renewal
Status string - Automatic renewal status. Valid values:
AutoRenewal
,Normal
. - Reserved
Instance stringName - 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://.
- Resource
Group stringId - Resource group ID.
- Scope string
- Scope of the RI. Optional values:
Region
: region-level,Zone
: zone-level. Default isRegion
. - Start
Time string - The time when the reserved instance took effect.
- Status string
- The status of the reserved instance.
- Dictionary<string, string>
- A mapping of tags to assign to the resource.
- Zone
Id 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.
- Allocation
Status string - 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. - Auto
Renew intPeriod - 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 whenperiod_unit
is set to Year: 12 - Create
Time string - The time when the reserved instance was created.
- Description string
- Description of the RI. 2 to 256 English or Chinese characters. It cannot start with
http://
orhttps://
. - Expired
Time string - The time when the reserved instance expires.
- Instance
Amount int - Number of instances allocated to an RI (An RI is a coupon that includes one or more allocated instances.).
- Instance
Type string - Instance type of the RI. For more information, see Instance type families.
- Name string
- Field
name
has been deprecated from provider version 1.194.0. New fieldreserved_instance_name
instead. - Offering
Type string - 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.
- Operation
Locks []ReservedInstance Operation Lock Args - Details about the lock status of the reserved instance.
- Period int
- The validity period of the reserved instance. Default value:
1
. NOTE: From version 1.183.0,period
can be set to5
, whenperiod_unit
isYear
.- When
period_unit
isYear
, Valid values:1
,3
,5
. - When
period_unit
isMonth
, Valid values:1
.
- When
- Period
Unit 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 toMonth
. - Platform string
- The operating system type of the image used by the instance. Optional values:
Windows
,Linux
. Default isLinux
. - Renewal
Status string - Automatic renewal status. Valid values:
AutoRenewal
,Normal
. - Reserved
Instance stringName - 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://.
- Resource
Group stringId - Resource group ID.
- Scope string
- Scope of the RI. Optional values:
Region
: region-level,Zone
: zone-level. Default isRegion
. - Start
Time string - The time when the reserved instance took effect.
- Status string
- The status of the reserved instance.
- map[string]string
- A mapping of tags to assign to the resource.
- Zone
Id 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.
- allocation
Status String - 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. - auto
Renew IntegerPeriod - 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 whenperiod_unit
is set to Year: 12 - create
Time String - The time when the reserved instance was created.
- description String
- Description of the RI. 2 to 256 English or Chinese characters. It cannot start with
http://
orhttps://
. - expired
Time String - The time when the reserved instance expires.
- instance
Amount Integer - Number of instances allocated to an RI (An RI is a coupon that includes one or more allocated instances.).
- instance
Type String - Instance type of the RI. For more information, see Instance type families.
- name String
- Field
name
has been deprecated from provider version 1.194.0. New fieldreserved_instance_name
instead. - offering
Type String - 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.
- operation
Locks List<ReservedInstance Operation Lock> - Details about the lock status of the reserved instance.
- period Integer
- The validity period of the reserved instance. Default value:
1
. NOTE: From version 1.183.0,period
can be set to5
, whenperiod_unit
isYear
.- When
period_unit
isYear
, Valid values:1
,3
,5
. - When
period_unit
isMonth
, Valid values:1
.
- When
- period
Unit 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 toMonth
. - platform String
- The operating system type of the image used by the instance. Optional values:
Windows
,Linux
. Default isLinux
. - renewal
Status String - Automatic renewal status. Valid values:
AutoRenewal
,Normal
. - reserved
Instance StringName - 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://.
- resource
Group StringId - Resource group ID.
- scope String
- Scope of the RI. Optional values:
Region
: region-level,Zone
: zone-level. Default isRegion
. - start
Time String - The time when the reserved instance took effect.
- status String
- The status of the reserved instance.
- Map<String,String>
- A mapping of tags to assign to the resource.
- zone
Id 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.
- allocation
Status string - 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. - auto
Renew numberPeriod - 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 whenperiod_unit
is set to Year: 12 - create
Time string - The time when the reserved instance was created.
- description string
- Description of the RI. 2 to 256 English or Chinese characters. It cannot start with
http://
orhttps://
. - expired
Time string - The time when the reserved instance expires.
- instance
Amount number - Number of instances allocated to an RI (An RI is a coupon that includes one or more allocated instances.).
- instance
Type string - Instance type of the RI. For more information, see Instance type families.
- name string
- Field
name
has been deprecated from provider version 1.194.0. New fieldreserved_instance_name
instead. - offering
Type string - 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.
- operation
Locks ReservedInstance Operation Lock[] - Details about the lock status of the reserved instance.
- period number
- The validity period of the reserved instance. Default value:
1
. NOTE: From version 1.183.0,period
can be set to5
, whenperiod_unit
isYear
.- When
period_unit
isYear
, Valid values:1
,3
,5
. - When
period_unit
isMonth
, Valid values:1
.
- When
- period
Unit 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 toMonth
. - platform string
- The operating system type of the image used by the instance. Optional values:
Windows
,Linux
. Default isLinux
. - renewal
Status string - Automatic renewal status. Valid values:
AutoRenewal
,Normal
. - reserved
Instance stringName - 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://.
- resource
Group stringId - Resource group ID.
- scope string
- Scope of the RI. Optional values:
Region
: region-level,Zone
: zone-level. Default isRegion
. - start
Time string - The time when the reserved instance took effect.
- status string
- The status of the reserved instance.
- {[key: string]: string}
- A mapping of tags to assign to the resource.
- zone
Id 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.
- allocation_
status str - 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. - auto_
renew_ intperiod - 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 whenperiod_unit
is set to Year: 12 - create_
time str - The time when the reserved instance was created.
- description str
- Description of the RI. 2 to 256 English or Chinese characters. It cannot start with
http://
orhttps://
. - expired_
time str - The time when the reserved instance expires.
- instance_
amount int - Number of instances allocated to an RI (An RI is a coupon that includes one or more allocated instances.).
- instance_
type str - Instance type of the RI. For more information, see Instance type families.
- name str
- Field
name
has been deprecated from provider version 1.194.0. New fieldreserved_instance_name
instead. - offering_
type str - 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.
- operation_
locks Sequence[ReservedInstance Operation Lock Args] - Details about the lock status of the reserved instance.
- period int
- The validity period of the reserved instance. Default value:
1
. NOTE: From version 1.183.0,period
can be set to5
, whenperiod_unit
isYear
.- When
period_unit
isYear
, Valid values:1
,3
,5
. - When
period_unit
isMonth
, Valid values:1
.
- When
- period_
unit str - 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 toMonth
. - platform str
- The operating system type of the image used by the instance. Optional values:
Windows
,Linux
. Default isLinux
. - renewal_
status str - Automatic renewal status. Valid values:
AutoRenewal
,Normal
. - reserved_
instance_ strname - 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://.
- resource_
group_ strid - Resource group ID.
- scope str
- Scope of the RI. Optional values:
Region
: region-level,Zone
: zone-level. Default isRegion
. - start_
time str - The time when the reserved instance took effect.
- status str
- The status of the reserved instance.
- Mapping[str, str]
- A mapping of tags to assign to the resource.
- zone_
id str - 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.
- allocation
Status String - 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. - auto
Renew NumberPeriod - 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 whenperiod_unit
is set to Year: 12 - create
Time String - The time when the reserved instance was created.
- description String
- Description of the RI. 2 to 256 English or Chinese characters. It cannot start with
http://
orhttps://
. - expired
Time String - The time when the reserved instance expires.
- instance
Amount Number - Number of instances allocated to an RI (An RI is a coupon that includes one or more allocated instances.).
- instance
Type String - Instance type of the RI. For more information, see Instance type families.
- name String
- Field
name
has been deprecated from provider version 1.194.0. New fieldreserved_instance_name
instead. - offering
Type String - 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.
- operation
Locks List<Property Map> - Details about the lock status of the reserved instance.
- period Number
- The validity period of the reserved instance. Default value:
1
. NOTE: From version 1.183.0,period
can be set to5
, whenperiod_unit
isYear
.- When
period_unit
isYear
, Valid values:1
,3
,5
. - When
period_unit
isMonth
, Valid values:1
.
- When
- period
Unit 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 toMonth
. - platform String
- The operating system type of the image used by the instance. Optional values:
Windows
,Linux
. Default isLinux
. - renewal
Status String - Automatic renewal status. Valid values:
AutoRenewal
,Normal
. - reserved
Instance StringName - 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://.
- resource
Group StringId - Resource group ID.
- scope String
- Scope of the RI. Optional values:
Region
: region-level,Zone
: zone-level. Default isRegion
. - start
Time String - The time when the reserved instance took effect.
- status String
- The status of the reserved instance.
- Map<String>
- A mapping of tags to assign to the resource.
- zone
Id 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.
Supporting Types
ReservedInstanceOperationLock, ReservedInstanceOperationLockArgs
- Lock
Reason string - The reason why the reserved instance was locked.
- Lock
Reason string - The reason why the reserved instance was locked.
- lock
Reason String - The reason why the reserved instance was locked.
- lock
Reason string - The reason why the reserved instance was locked.
- lock_
reason str - The reason why the reserved instance was locked.
- lock
Reason String - The reason why the reserved instance was locked.
Import
reservedInstance can be imported using id, e.g.
$ pulumi import alicloud:ecs/reservedInstance:ReservedInstance default ecsri-uf6df4xm0h3licit****
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.