1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. ReservedInstance
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

tencentcloud.ReservedInstance

Explore with Pulumi AI

tencentcloud logo
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

    Provides a reserved instance resource.

    NOTE: Reserved instance cannot be deleted and updated. The reserved instance still exist which can be extracted by reserved_instances data source when reserved instance is destroied.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const ri = new tencentcloud.ReservedInstance("ri", {
        configId: "469043dd-28b9-4d89-b557-74f6a8326259",
        instanceCount: 2,
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    ri = tencentcloud.ReservedInstance("ri",
        config_id="469043dd-28b9-4d89-b557-74f6a8326259",
        instance_count=2)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := tencentcloud.NewReservedInstance(ctx, "ri", &tencentcloud.ReservedInstanceArgs{
    			ConfigId:      pulumi.String("469043dd-28b9-4d89-b557-74f6a8326259"),
    			InstanceCount: pulumi.Float64(2),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Tencentcloud = Pulumi.Tencentcloud;
    
    return await Deployment.RunAsync(() => 
    {
        var ri = new Tencentcloud.ReservedInstance("ri", new()
        {
            ConfigId = "469043dd-28b9-4d89-b557-74f6a8326259",
            InstanceCount = 2,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.ReservedInstance;
    import com.pulumi.tencentcloud.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) {
            var ri = new ReservedInstance("ri", ReservedInstanceArgs.builder()
                .configId("469043dd-28b9-4d89-b557-74f6a8326259")
                .instanceCount(2)
                .build());
    
        }
    }
    
    resources:
      ri:
        type: tencentcloud:ReservedInstance
        properties:
          configId: 469043dd-28b9-4d89-b557-74f6a8326259
          instanceCount: 2
    

    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,
                         config_id: Optional[str] = None,
                         instance_count: Optional[float] = None,
                         reserved_instance_id: Optional[str] = None,
                         reserved_instance_name: 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: tencentcloud: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.

    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:

    ConfigId string
    Configuration ID of the reserved instance.
    InstanceCount double
    Number of reserved instances to be purchased.
    ReservedInstanceId string
    ID of the resource.
    ReservedInstanceName string
    Reserved Instance display name.

    • If you do not specify an instance display name, 'Unnamed' is displayed by default.
    • Up to 60 characters (including pattern strings) are supported.
    ConfigId string
    Configuration ID of the reserved instance.
    InstanceCount float64
    Number of reserved instances to be purchased.
    ReservedInstanceId string
    ID of the resource.
    ReservedInstanceName string
    Reserved Instance display name.

    • If you do not specify an instance display name, 'Unnamed' is displayed by default.
    • Up to 60 characters (including pattern strings) are supported.
    configId String
    Configuration ID of the reserved instance.
    instanceCount Double
    Number of reserved instances to be purchased.
    reservedInstanceId String
    ID of the resource.
    reservedInstanceName String
    Reserved Instance display name.

    • If you do not specify an instance display name, 'Unnamed' is displayed by default.
    • Up to 60 characters (including pattern strings) are supported.
    configId string
    Configuration ID of the reserved instance.
    instanceCount number
    Number of reserved instances to be purchased.
    reservedInstanceId string
    ID of the resource.
    reservedInstanceName string
    Reserved Instance display name.

    • If you do not specify an instance display name, 'Unnamed' is displayed by default.
    • Up to 60 characters (including pattern strings) are supported.
    config_id str
    Configuration ID of the reserved instance.
    instance_count float
    Number of reserved instances to be purchased.
    reserved_instance_id str
    ID of the resource.
    reserved_instance_name str
    Reserved Instance display name.

    • If you do not specify an instance display name, 'Unnamed' is displayed by default.
    • Up to 60 characters (including pattern strings) are supported.
    configId String
    Configuration ID of the reserved instance.
    instanceCount Number
    Number of reserved instances to be purchased.
    reservedInstanceId String
    ID of the resource.
    reservedInstanceName String
    Reserved Instance display name.

    • If you do not specify an instance display name, 'Unnamed' is displayed by default.
    • Up to 60 characters (including pattern strings) are supported.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the ReservedInstance resource produces the following output properties:

    EndTime string
    Expiry time of the RI.
    Id string
    The provider-assigned unique ID for this managed resource.
    StartTime string
    Start time of the RI.
    Status string
    Status of the RI at the time of purchase.
    EndTime string
    Expiry time of the RI.
    Id string
    The provider-assigned unique ID for this managed resource.
    StartTime string
    Start time of the RI.
    Status string
    Status of the RI at the time of purchase.
    endTime String
    Expiry time of the RI.
    id String
    The provider-assigned unique ID for this managed resource.
    startTime String
    Start time of the RI.
    status String
    Status of the RI at the time of purchase.
    endTime string
    Expiry time of the RI.
    id string
    The provider-assigned unique ID for this managed resource.
    startTime string
    Start time of the RI.
    status string
    Status of the RI at the time of purchase.
    end_time str
    Expiry time of the RI.
    id str
    The provider-assigned unique ID for this managed resource.
    start_time str
    Start time of the RI.
    status str
    Status of the RI at the time of purchase.
    endTime String
    Expiry time of the RI.
    id String
    The provider-assigned unique ID for this managed resource.
    startTime String
    Start time of the RI.
    status String
    Status of the RI at the time of purchase.

    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,
            config_id: Optional[str] = None,
            end_time: Optional[str] = None,
            instance_count: Optional[float] = None,
            reserved_instance_id: Optional[str] = None,
            reserved_instance_name: Optional[str] = None,
            start_time: Optional[str] = None,
            status: 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)
    resources:  _:    type: tencentcloud:ReservedInstance    get:      id: ${id}
    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:
    ConfigId string
    Configuration ID of the reserved instance.
    EndTime string
    Expiry time of the RI.
    InstanceCount double
    Number of reserved instances to be purchased.
    ReservedInstanceId string
    ID of the resource.
    ReservedInstanceName string
    Reserved Instance display name.

    • If you do not specify an instance display name, 'Unnamed' is displayed by default.
    • Up to 60 characters (including pattern strings) are supported.
    StartTime string
    Start time of the RI.
    Status string
    Status of the RI at the time of purchase.
    ConfigId string
    Configuration ID of the reserved instance.
    EndTime string
    Expiry time of the RI.
    InstanceCount float64
    Number of reserved instances to be purchased.
    ReservedInstanceId string
    ID of the resource.
    ReservedInstanceName string
    Reserved Instance display name.

    • If you do not specify an instance display name, 'Unnamed' is displayed by default.
    • Up to 60 characters (including pattern strings) are supported.
    StartTime string
    Start time of the RI.
    Status string
    Status of the RI at the time of purchase.
    configId String
    Configuration ID of the reserved instance.
    endTime String
    Expiry time of the RI.
    instanceCount Double
    Number of reserved instances to be purchased.
    reservedInstanceId String
    ID of the resource.
    reservedInstanceName String
    Reserved Instance display name.

    • If you do not specify an instance display name, 'Unnamed' is displayed by default.
    • Up to 60 characters (including pattern strings) are supported.
    startTime String
    Start time of the RI.
    status String
    Status of the RI at the time of purchase.
    configId string
    Configuration ID of the reserved instance.
    endTime string
    Expiry time of the RI.
    instanceCount number
    Number of reserved instances to be purchased.
    reservedInstanceId string
    ID of the resource.
    reservedInstanceName string
    Reserved Instance display name.

    • If you do not specify an instance display name, 'Unnamed' is displayed by default.
    • Up to 60 characters (including pattern strings) are supported.
    startTime string
    Start time of the RI.
    status string
    Status of the RI at the time of purchase.
    config_id str
    Configuration ID of the reserved instance.
    end_time str
    Expiry time of the RI.
    instance_count float
    Number of reserved instances to be purchased.
    reserved_instance_id str
    ID of the resource.
    reserved_instance_name str
    Reserved Instance display name.

    • If you do not specify an instance display name, 'Unnamed' is displayed by default.
    • Up to 60 characters (including pattern strings) are supported.
    start_time str
    Start time of the RI.
    status str
    Status of the RI at the time of purchase.
    configId String
    Configuration ID of the reserved instance.
    endTime String
    Expiry time of the RI.
    instanceCount Number
    Number of reserved instances to be purchased.
    reservedInstanceId String
    ID of the resource.
    reservedInstanceName String
    Reserved Instance display name.

    • If you do not specify an instance display name, 'Unnamed' is displayed by default.
    • Up to 60 characters (including pattern strings) are supported.
    startTime String
    Start time of the RI.
    status String
    Status of the RI at the time of purchase.

    Import

    Reserved instance can be imported using the id, e.g.

    $ pulumi import tencentcloud:index/reservedInstance:ReservedInstance foo 6cc16e7c-47d7-4fae-9b44-ce5c0f59a920
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    tencentcloud tencentcloudstack/terraform-provider-tencentcloud
    License
    Notes
    This Pulumi package is based on the tencentcloud Terraform Provider.
    tencentcloud logo
    tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack