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

tencentcloud.getReservedInstances

Explore with Pulumi AI

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

    Use this data source to query reserved instances.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const instances = tencentcloud.getReservedInstances({
        availabilityZone: "na-siliconvalley-1",
        instanceType: "S2.MEDIUM8",
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    instances = tencentcloud.get_reserved_instances(availability_zone="na-siliconvalley-1",
        instance_type="S2.MEDIUM8")
    
    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.GetReservedInstances(ctx, &tencentcloud.GetReservedInstancesArgs{
    			AvailabilityZone: pulumi.StringRef("na-siliconvalley-1"),
    			InstanceType:     pulumi.StringRef("S2.MEDIUM8"),
    		}, nil)
    		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 instances = Tencentcloud.GetReservedInstances.Invoke(new()
        {
            AvailabilityZone = "na-siliconvalley-1",
            InstanceType = "S2.MEDIUM8",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.TencentcloudFunctions;
    import com.pulumi.tencentcloud.inputs.GetReservedInstancesArgs;
    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 instances = TencentcloudFunctions.getReservedInstances(GetReservedInstancesArgs.builder()
                .availabilityZone("na-siliconvalley-1")
                .instanceType("S2.MEDIUM8")
                .build());
    
        }
    }
    
    variables:
      instances:
        fn::invoke:
          function: tencentcloud:getReservedInstances
          arguments:
            availabilityZone: na-siliconvalley-1
            instanceType: S2.MEDIUM8
    

    Using getReservedInstances

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getReservedInstances(args: GetReservedInstancesArgs, opts?: InvokeOptions): Promise<GetReservedInstancesResult>
    function getReservedInstancesOutput(args: GetReservedInstancesOutputArgs, opts?: InvokeOptions): Output<GetReservedInstancesResult>
    def get_reserved_instances(availability_zone: Optional[str] = None,
                               id: Optional[str] = None,
                               instance_type: Optional[str] = None,
                               reserved_instance_id: Optional[str] = None,
                               result_output_file: Optional[str] = None,
                               opts: Optional[InvokeOptions] = None) -> GetReservedInstancesResult
    def get_reserved_instances_output(availability_zone: Optional[pulumi.Input[str]] = None,
                               id: Optional[pulumi.Input[str]] = None,
                               instance_type: Optional[pulumi.Input[str]] = None,
                               reserved_instance_id: Optional[pulumi.Input[str]] = None,
                               result_output_file: Optional[pulumi.Input[str]] = None,
                               opts: Optional[InvokeOptions] = None) -> Output[GetReservedInstancesResult]
    func GetReservedInstances(ctx *Context, args *GetReservedInstancesArgs, opts ...InvokeOption) (*GetReservedInstancesResult, error)
    func GetReservedInstancesOutput(ctx *Context, args *GetReservedInstancesOutputArgs, opts ...InvokeOption) GetReservedInstancesResultOutput

    > Note: This function is named GetReservedInstances in the Go SDK.

    public static class GetReservedInstances 
    {
        public static Task<GetReservedInstancesResult> InvokeAsync(GetReservedInstancesArgs args, InvokeOptions? opts = null)
        public static Output<GetReservedInstancesResult> Invoke(GetReservedInstancesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetReservedInstancesResult> getReservedInstances(GetReservedInstancesArgs args, InvokeOptions options)
    public static Output<GetReservedInstancesResult> getReservedInstances(GetReservedInstancesArgs args, InvokeOptions options)
    
    fn::invoke:
      function: tencentcloud:index/getReservedInstances:getReservedInstances
      arguments:
        # arguments dictionary

    The following arguments are supported:

    AvailabilityZone string
    The available zone that the reserved instance locates at.
    Id string
    InstanceType string
    The type of reserved instance.
    ReservedInstanceId string
    ID of the reserved instance to be query.
    ResultOutputFile string
    Used to save results.
    AvailabilityZone string
    The available zone that the reserved instance locates at.
    Id string
    InstanceType string
    The type of reserved instance.
    ReservedInstanceId string
    ID of the reserved instance to be query.
    ResultOutputFile string
    Used to save results.
    availabilityZone String
    The available zone that the reserved instance locates at.
    id String
    instanceType String
    The type of reserved instance.
    reservedInstanceId String
    ID of the reserved instance to be query.
    resultOutputFile String
    Used to save results.
    availabilityZone string
    The available zone that the reserved instance locates at.
    id string
    instanceType string
    The type of reserved instance.
    reservedInstanceId string
    ID of the reserved instance to be query.
    resultOutputFile string
    Used to save results.
    availability_zone str
    The available zone that the reserved instance locates at.
    id str
    instance_type str
    The type of reserved instance.
    reserved_instance_id str
    ID of the reserved instance to be query.
    result_output_file str
    Used to save results.
    availabilityZone String
    The available zone that the reserved instance locates at.
    id String
    instanceType String
    The type of reserved instance.
    reservedInstanceId String
    ID of the reserved instance to be query.
    resultOutputFile String
    Used to save results.

    getReservedInstances Result

    The following output properties are available:

    Id string
    ReservedInstanceLists List<GetReservedInstancesReservedInstanceList>
    An information list of reserved instance. Each element contains the following attributes:
    AvailabilityZone string
    Availability zone of the reserved instance.
    InstanceType string
    The type of reserved instance.
    ReservedInstanceId string
    ID of the reserved instance.
    ResultOutputFile string
    Id string
    ReservedInstanceLists []GetReservedInstancesReservedInstanceList
    An information list of reserved instance. Each element contains the following attributes:
    AvailabilityZone string
    Availability zone of the reserved instance.
    InstanceType string
    The type of reserved instance.
    ReservedInstanceId string
    ID of the reserved instance.
    ResultOutputFile string
    id String
    reservedInstanceLists List<GetReservedInstancesReservedInstanceList>
    An information list of reserved instance. Each element contains the following attributes:
    availabilityZone String
    Availability zone of the reserved instance.
    instanceType String
    The type of reserved instance.
    reservedInstanceId String
    ID of the reserved instance.
    resultOutputFile String
    id string
    reservedInstanceLists GetReservedInstancesReservedInstanceList[]
    An information list of reserved instance. Each element contains the following attributes:
    availabilityZone string
    Availability zone of the reserved instance.
    instanceType string
    The type of reserved instance.
    reservedInstanceId string
    ID of the reserved instance.
    resultOutputFile string
    id str
    reserved_instance_lists Sequence[GetReservedInstancesReservedInstanceList]
    An information list of reserved instance. Each element contains the following attributes:
    availability_zone str
    Availability zone of the reserved instance.
    instance_type str
    The type of reserved instance.
    reserved_instance_id str
    ID of the reserved instance.
    result_output_file str
    id String
    reservedInstanceLists List<Property Map>
    An information list of reserved instance. Each element contains the following attributes:
    availabilityZone String
    Availability zone of the reserved instance.
    instanceType String
    The type of reserved instance.
    reservedInstanceId String
    ID of the reserved instance.
    resultOutputFile String

    Supporting Types

    GetReservedInstancesReservedInstanceList

    AvailabilityZone string
    The available zone that the reserved instance locates at.
    EndTime string
    Expiry time of the reserved instance.
    InstanceCount double
    Number of reserved instance.
    InstanceType string
    The type of reserved instance.
    ReservedInstanceId string
    ID of the reserved instance to be query.
    StartTime string
    Start time of the reserved instance.
    Status string
    Status of the reserved instance.
    AvailabilityZone string
    The available zone that the reserved instance locates at.
    EndTime string
    Expiry time of the reserved instance.
    InstanceCount float64
    Number of reserved instance.
    InstanceType string
    The type of reserved instance.
    ReservedInstanceId string
    ID of the reserved instance to be query.
    StartTime string
    Start time of the reserved instance.
    Status string
    Status of the reserved instance.
    availabilityZone String
    The available zone that the reserved instance locates at.
    endTime String
    Expiry time of the reserved instance.
    instanceCount Double
    Number of reserved instance.
    instanceType String
    The type of reserved instance.
    reservedInstanceId String
    ID of the reserved instance to be query.
    startTime String
    Start time of the reserved instance.
    status String
    Status of the reserved instance.
    availabilityZone string
    The available zone that the reserved instance locates at.
    endTime string
    Expiry time of the reserved instance.
    instanceCount number
    Number of reserved instance.
    instanceType string
    The type of reserved instance.
    reservedInstanceId string
    ID of the reserved instance to be query.
    startTime string
    Start time of the reserved instance.
    status string
    Status of the reserved instance.
    availability_zone str
    The available zone that the reserved instance locates at.
    end_time str
    Expiry time of the reserved instance.
    instance_count float
    Number of reserved instance.
    instance_type str
    The type of reserved instance.
    reserved_instance_id str
    ID of the reserved instance to be query.
    start_time str
    Start time of the reserved instance.
    status str
    Status of the reserved instance.
    availabilityZone String
    The available zone that the reserved instance locates at.
    endTime String
    Expiry time of the reserved instance.
    instanceCount Number
    Number of reserved instance.
    instanceType String
    The type of reserved instance.
    reservedInstanceId String
    ID of the reserved instance to be query.
    startTime String
    Start time of the reserved instance.
    status String
    Status of the reserved instance.

    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