1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. ecs
  5. ReservedInstance
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

alicloud.ecs.ReservedInstance

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

    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, Any]] = 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", "any" },
        },
        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.Map{
    		"string": pulumi.Any("any"),
    	},
    	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", "any"))
        .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": "any",
        },
        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: "any",
        },
        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: any
        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

    The ReservedInstance resource accepts the following input properties:

    InstanceType string
    Instance type of the RI. For more information, see Instance type families.
    AutoRenewPeriod 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
    Description string
    Description of the RI. 2 to 256 English or Chinese characters. It cannot start with http:// or https://.
    InstanceAmount 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 field reserved_instance_name instead.

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

    OfferingType 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 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.
    PeriodUnit 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.
    Platform string
    The operating system type of the image used by the instance. Optional values: Windows, Linux. Default is Linux.
    RenewalStatus string
    Automatic renewal status. Valid values: AutoRenewal,Normal.
    ReservedInstanceName string
    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://.
    ResourceGroupId string
    Resource group ID.
    Scope string
    Scope of the RI. Optional values: Region: region-level, Zone: zone-level. Default is Region.
    Tags Dictionary<string, object>
    A mapping of tags to assign to the resource.
    ZoneId 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.
    InstanceType string
    Instance type of the RI. For more information, see Instance type families.
    AutoRenewPeriod 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
    Description string
    Description of the RI. 2 to 256 English or Chinese characters. It cannot start with http:// or https://.
    InstanceAmount 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 field reserved_instance_name instead.

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

    OfferingType 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 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.
    PeriodUnit 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.
    Platform string
    The operating system type of the image used by the instance. Optional values: Windows, Linux. Default is Linux.
    RenewalStatus string
    Automatic renewal status. Valid values: AutoRenewal,Normal.
    ReservedInstanceName string
    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://.
    ResourceGroupId string
    Resource group ID.
    Scope string
    Scope of the RI. Optional values: Region: region-level, Zone: zone-level. Default is Region.
    Tags map[string]interface{}
    A mapping of tags to assign to the resource.
    ZoneId 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.
    instanceType String
    Instance type of the RI. For more information, see Instance type families.
    autoRenewPeriod Integer
    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
    description String
    Description of the RI. 2 to 256 English or Chinese characters. It cannot start with http:// or https://.
    instanceAmount 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 field reserved_instance_name instead.

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

    offeringType 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 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.
    periodUnit 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.
    platform String
    The operating system type of the image used by the instance. Optional values: Windows, Linux. Default is Linux.
    renewalStatus String
    Automatic renewal status. Valid values: AutoRenewal,Normal.
    reservedInstanceName String
    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://.
    resourceGroupId String
    Resource group ID.
    scope String
    Scope of the RI. Optional values: Region: region-level, Zone: zone-level. Default is Region.
    tags Map<String,Object>
    A mapping of tags to assign to the resource.
    zoneId 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.
    instanceType string
    Instance type of the RI. For more information, see Instance type families.
    autoRenewPeriod number
    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
    description string
    Description of the RI. 2 to 256 English or Chinese characters. It cannot start with http:// or https://.
    instanceAmount 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 field reserved_instance_name instead.

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

    offeringType 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 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.
    periodUnit 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.
    platform string
    The operating system type of the image used by the instance. Optional values: Windows, Linux. Default is Linux.
    renewalStatus string
    Automatic renewal status. Valid values: AutoRenewal,Normal.
    reservedInstanceName string
    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://.
    resourceGroupId string
    Resource group ID.
    scope string
    Scope of the RI. Optional values: Region: region-level, Zone: zone-level. Default is Region.
    tags {[key: string]: any}
    A mapping of tags to assign to the resource.
    zoneId 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_period 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
    description str
    Description of the RI. 2 to 256 English or Chinese characters. It cannot start with http:// or https://.
    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 field reserved_instance_name instead.

    Deprecated: Field 'name' has been deprecated from provider version 1.194.0. New field 'reserved_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 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.
    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 to Month.
    platform str
    The operating system type of the image used by the instance. Optional values: Windows, Linux. Default is Linux.
    renewal_status str
    Automatic renewal status. Valid values: AutoRenewal,Normal.
    reserved_instance_name str
    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_id str
    Resource group ID.
    scope str
    Scope of the RI. Optional values: Region: region-level, Zone: zone-level. Default is Region.
    tags Mapping[str, Any]
    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.
    instanceType String
    Instance type of the RI. For more information, see Instance type families.
    autoRenewPeriod Number
    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
    description String
    Description of the RI. 2 to 256 English or Chinese characters. It cannot start with http:// or https://.
    instanceAmount 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 field reserved_instance_name instead.

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

    offeringType 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 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.
    periodUnit 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.
    platform String
    The operating system type of the image used by the instance. Optional values: Windows, Linux. Default is Linux.
    renewalStatus String
    Automatic renewal status. Valid values: AutoRenewal,Normal.
    reservedInstanceName String
    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://.
    resourceGroupId String
    Resource group ID.
    scope String
    Scope of the RI. Optional values: Region: region-level, Zone: zone-level. Default is Region.
    tags Map<Any>
    A mapping of tags to assign to the resource.
    zoneId 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:

    AllocationStatus 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.
    CreateTime string
    The time when the reserved instance was created.
    ExpiredTime string
    The time when the reserved instance expires.
    Id string
    The provider-assigned unique ID for this managed resource.
    OperationLocks List<Pulumi.AliCloud.Ecs.Outputs.ReservedInstanceOperationLock>
    Details about the lock status of the reserved instance.
    StartTime string
    The time when the reserved instance took effect.
    Status string
    The status of the reserved instance.
    AllocationStatus 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.
    CreateTime string
    The time when the reserved instance was created.
    ExpiredTime string
    The time when the reserved instance expires.
    Id string
    The provider-assigned unique ID for this managed resource.
    OperationLocks []ReservedInstanceOperationLock
    Details about the lock status of the reserved instance.
    StartTime string
    The time when the reserved instance took effect.
    Status string
    The status of the reserved instance.
    allocationStatus 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.
    createTime String
    The time when the reserved instance was created.
    expiredTime String
    The time when the reserved instance expires.
    id String
    The provider-assigned unique ID for this managed resource.
    operationLocks List<ReservedInstanceOperationLock>
    Details about the lock status of the reserved instance.
    startTime String
    The time when the reserved instance took effect.
    status String
    The status of the reserved instance.
    allocationStatus 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.
    createTime string
    The time when the reserved instance was created.
    expiredTime string
    The time when the reserved instance expires.
    id string
    The provider-assigned unique ID for this managed resource.
    operationLocks ReservedInstanceOperationLock[]
    Details about the lock status of the reserved instance.
    startTime 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[ReservedInstanceOperationLock]
    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.
    allocationStatus 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.
    createTime String
    The time when the reserved instance was created.
    expiredTime String
    The time when the reserved instance expires.
    id String
    The provider-assigned unique ID for this managed resource.
    operationLocks List<Property Map>
    Details about the lock status of the reserved instance.
    startTime 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, Any]] = 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.
    The following state arguments are supported:
    AllocationStatus 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.
    AutoRenewPeriod 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
    CreateTime 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:// or https://.
    ExpiredTime string
    The time when the reserved instance expires.
    InstanceAmount int
    Number of instances allocated to an RI (An RI is a coupon that includes one or more allocated instances.).
    InstanceType 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 field reserved_instance_name instead.

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

    OfferingType 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.
    OperationLocks List<Pulumi.AliCloud.Ecs.Inputs.ReservedInstanceOperationLock>
    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 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.
    PeriodUnit 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.
    Platform string
    The operating system type of the image used by the instance. Optional values: Windows, Linux. Default is Linux.
    RenewalStatus string
    Automatic renewal status. Valid values: AutoRenewal,Normal.
    ReservedInstanceName string
    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://.
    ResourceGroupId string
    Resource group ID.
    Scope string
    Scope of the RI. Optional values: Region: region-level, Zone: zone-level. Default is Region.
    StartTime string
    The time when the reserved instance took effect.
    Status string
    The status of the reserved instance.
    Tags Dictionary<string, object>
    A mapping of tags to assign to the resource.
    ZoneId 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.
    AllocationStatus 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.
    AutoRenewPeriod 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
    CreateTime 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:// or https://.
    ExpiredTime string
    The time when the reserved instance expires.
    InstanceAmount int
    Number of instances allocated to an RI (An RI is a coupon that includes one or more allocated instances.).
    InstanceType 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 field reserved_instance_name instead.

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

    OfferingType 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.
    OperationLocks []ReservedInstanceOperationLockArgs
    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 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.
    PeriodUnit 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.
    Platform string
    The operating system type of the image used by the instance. Optional values: Windows, Linux. Default is Linux.
    RenewalStatus string
    Automatic renewal status. Valid values: AutoRenewal,Normal.
    ReservedInstanceName string
    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://.
    ResourceGroupId string
    Resource group ID.
    Scope string
    Scope of the RI. Optional values: Region: region-level, Zone: zone-level. Default is Region.
    StartTime string
    The time when the reserved instance took effect.
    Status string
    The status of the reserved instance.
    Tags map[string]interface{}
    A mapping of tags to assign to the resource.
    ZoneId 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.
    allocationStatus 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.
    autoRenewPeriod Integer
    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
    createTime 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:// or https://.
    expiredTime String
    The time when the reserved instance expires.
    instanceAmount Integer
    Number of instances allocated to an RI (An RI is a coupon that includes one or more allocated instances.).
    instanceType 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 field reserved_instance_name instead.

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

    offeringType 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.
    operationLocks List<ReservedInstanceOperationLock>
    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 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.
    periodUnit 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.
    platform String
    The operating system type of the image used by the instance. Optional values: Windows, Linux. Default is Linux.
    renewalStatus String
    Automatic renewal status. Valid values: AutoRenewal,Normal.
    reservedInstanceName String
    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://.
    resourceGroupId String
    Resource group ID.
    scope String
    Scope of the RI. Optional values: Region: region-level, Zone: zone-level. Default is Region.
    startTime String
    The time when the reserved instance took effect.
    status String
    The status of the reserved instance.
    tags Map<String,Object>
    A mapping of tags to assign to the resource.
    zoneId 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.
    allocationStatus 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.
    autoRenewPeriod number
    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
    createTime 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:// or https://.
    expiredTime string
    The time when the reserved instance expires.
    instanceAmount number
    Number of instances allocated to an RI (An RI is a coupon that includes one or more allocated instances.).
    instanceType 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 field reserved_instance_name instead.

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

    offeringType 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.
    operationLocks ReservedInstanceOperationLock[]
    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 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.
    periodUnit 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.
    platform string
    The operating system type of the image used by the instance. Optional values: Windows, Linux. Default is Linux.
    renewalStatus string
    Automatic renewal status. Valid values: AutoRenewal,Normal.
    reservedInstanceName string
    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://.
    resourceGroupId string
    Resource group ID.
    scope string
    Scope of the RI. Optional values: Region: region-level, Zone: zone-level. Default is Region.
    startTime string
    The time when the reserved instance took effect.
    status string
    The status of the reserved instance.
    tags {[key: string]: any}
    A mapping of tags to assign to the resource.
    zoneId 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_period 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
    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:// or https://.
    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 field reserved_instance_name instead.

    Deprecated: Field 'name' has been deprecated from provider version 1.194.0. New field 'reserved_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[ReservedInstanceOperationLockArgs]
    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 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.
    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 to Month.
    platform str
    The operating system type of the image used by the instance. Optional values: Windows, Linux. Default is Linux.
    renewal_status str
    Automatic renewal status. Valid values: AutoRenewal,Normal.
    reserved_instance_name str
    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_id str
    Resource group ID.
    scope str
    Scope of the RI. Optional values: Region: region-level, Zone: zone-level. Default is Region.
    start_time str
    The time when the reserved instance took effect.
    status str
    The status of the reserved instance.
    tags Mapping[str, Any]
    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.
    allocationStatus 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.
    autoRenewPeriod Number
    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
    createTime 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:// or https://.
    expiredTime String
    The time when the reserved instance expires.
    instanceAmount Number
    Number of instances allocated to an RI (An RI is a coupon that includes one or more allocated instances.).
    instanceType 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 field reserved_instance_name instead.

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

    offeringType 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.
    operationLocks 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 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.
    periodUnit 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.
    platform String
    The operating system type of the image used by the instance. Optional values: Windows, Linux. Default is Linux.
    renewalStatus String
    Automatic renewal status. Valid values: AutoRenewal,Normal.
    reservedInstanceName String
    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://.
    resourceGroupId String
    Resource group ID.
    scope String
    Scope of the RI. Optional values: Region: region-level, Zone: zone-level. Default is Region.
    startTime String
    The time when the reserved instance took effect.
    status String
    The status of the reserved instance.
    tags Map<Any>
    A mapping of tags to assign to the resource.
    zoneId 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

    LockReason string
    The reason why the reserved instance was locked.
    LockReason string
    The reason why the reserved instance was locked.
    lockReason String
    The reason why the reserved instance was locked.
    lockReason string
    The reason why the reserved instance was locked.
    lock_reason str
    The reason why the reserved instance was locked.
    lockReason 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.
    alicloud logo
    Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi