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

tencentcloud.getInstancesSet

Explore with Pulumi AI

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

    Use this data source to query cvm instances in parallel.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const example = tencentcloud.getInstancesSet({
        availabilityZone: "ap-guangzhou-6",
        instanceId: "ins-a81rnm8c",
        instanceName: "tf_example",
        projectId: 0,
        subnetId: "subnet-1to7t9au",
        tags: {
            tagKey: "tagValue",
        },
        vpcId: "vpc-l040hycv",
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    example = tencentcloud.get_instances_set(availability_zone="ap-guangzhou-6",
        instance_id="ins-a81rnm8c",
        instance_name="tf_example",
        project_id=0,
        subnet_id="subnet-1to7t9au",
        tags={
            "tagKey": "tagValue",
        },
        vpc_id="vpc-l040hycv")
    
    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.GetInstancesSet(ctx, &tencentcloud.GetInstancesSetArgs{
    			AvailabilityZone: pulumi.StringRef("ap-guangzhou-6"),
    			InstanceId:       pulumi.StringRef("ins-a81rnm8c"),
    			InstanceName:     pulumi.StringRef("tf_example"),
    			ProjectId:        pulumi.Float64Ref(0),
    			SubnetId:         pulumi.StringRef("subnet-1to7t9au"),
    			Tags: map[string]interface{}{
    				"tagKey": "tagValue",
    			},
    			VpcId: pulumi.StringRef("vpc-l040hycv"),
    		}, 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 example = Tencentcloud.GetInstancesSet.Invoke(new()
        {
            AvailabilityZone = "ap-guangzhou-6",
            InstanceId = "ins-a81rnm8c",
            InstanceName = "tf_example",
            ProjectId = 0,
            SubnetId = "subnet-1to7t9au",
            Tags = 
            {
                { "tagKey", "tagValue" },
            },
            VpcId = "vpc-l040hycv",
        });
    
    });
    
    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.GetInstancesSetArgs;
    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 example = TencentcloudFunctions.getInstancesSet(GetInstancesSetArgs.builder()
                .availabilityZone("ap-guangzhou-6")
                .instanceId("ins-a81rnm8c")
                .instanceName("tf_example")
                .projectId(0)
                .subnetId("subnet-1to7t9au")
                .tags(Map.of("tagKey", "tagValue"))
                .vpcId("vpc-l040hycv")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: tencentcloud:getInstancesSet
          arguments:
            availabilityZone: ap-guangzhou-6
            instanceId: ins-a81rnm8c
            instanceName: tf_example
            projectId: 0
            subnetId: subnet-1to7t9au
            tags:
              tagKey: tagValue
            vpcId: vpc-l040hycv
    

    Using getInstancesSet

    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 getInstancesSet(args: GetInstancesSetArgs, opts?: InvokeOptions): Promise<GetInstancesSetResult>
    function getInstancesSetOutput(args: GetInstancesSetOutputArgs, opts?: InvokeOptions): Output<GetInstancesSetResult>
    def get_instances_set(availability_zone: Optional[str] = None,
                          id: Optional[str] = None,
                          instance_id: Optional[str] = None,
                          instance_name: Optional[str] = None,
                          project_id: Optional[float] = None,
                          result_output_file: Optional[str] = None,
                          subnet_id: Optional[str] = None,
                          tags: Optional[Mapping[str, str]] = None,
                          vpc_id: Optional[str] = None,
                          opts: Optional[InvokeOptions] = None) -> GetInstancesSetResult
    def get_instances_set_output(availability_zone: Optional[pulumi.Input[str]] = None,
                          id: Optional[pulumi.Input[str]] = None,
                          instance_id: Optional[pulumi.Input[str]] = None,
                          instance_name: Optional[pulumi.Input[str]] = None,
                          project_id: Optional[pulumi.Input[float]] = None,
                          result_output_file: Optional[pulumi.Input[str]] = None,
                          subnet_id: Optional[pulumi.Input[str]] = None,
                          tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                          vpc_id: Optional[pulumi.Input[str]] = None,
                          opts: Optional[InvokeOptions] = None) -> Output[GetInstancesSetResult]
    func GetInstancesSet(ctx *Context, args *GetInstancesSetArgs, opts ...InvokeOption) (*GetInstancesSetResult, error)
    func GetInstancesSetOutput(ctx *Context, args *GetInstancesSetOutputArgs, opts ...InvokeOption) GetInstancesSetResultOutput

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

    public static class GetInstancesSet 
    {
        public static Task<GetInstancesSetResult> InvokeAsync(GetInstancesSetArgs args, InvokeOptions? opts = null)
        public static Output<GetInstancesSetResult> Invoke(GetInstancesSetInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetInstancesSetResult> getInstancesSet(GetInstancesSetArgs args, InvokeOptions options)
    public static Output<GetInstancesSetResult> getInstancesSet(GetInstancesSetArgs args, InvokeOptions options)
    
    fn::invoke:
      function: tencentcloud:index/getInstancesSet:getInstancesSet
      arguments:
        # arguments dictionary

    The following arguments are supported:

    AvailabilityZone string
    The available zone that the CVM instance locates at.
    Id string
    InstanceId string
    ID of the instances to be queried.
    InstanceName string
    Name of the instances to be queried.
    ProjectId double
    The project CVM belongs to.
    ResultOutputFile string
    Used to save results.
    SubnetId string
    ID of a vpc subnetwork.
    Tags Dictionary<string, string>
    Tags of the instance.
    VpcId string
    ID of the vpc to be queried.
    AvailabilityZone string
    The available zone that the CVM instance locates at.
    Id string
    InstanceId string
    ID of the instances to be queried.
    InstanceName string
    Name of the instances to be queried.
    ProjectId float64
    The project CVM belongs to.
    ResultOutputFile string
    Used to save results.
    SubnetId string
    ID of a vpc subnetwork.
    Tags map[string]string
    Tags of the instance.
    VpcId string
    ID of the vpc to be queried.
    availabilityZone String
    The available zone that the CVM instance locates at.
    id String
    instanceId String
    ID of the instances to be queried.
    instanceName String
    Name of the instances to be queried.
    projectId Double
    The project CVM belongs to.
    resultOutputFile String
    Used to save results.
    subnetId String
    ID of a vpc subnetwork.
    tags Map<String,String>
    Tags of the instance.
    vpcId String
    ID of the vpc to be queried.
    availabilityZone string
    The available zone that the CVM instance locates at.
    id string
    instanceId string
    ID of the instances to be queried.
    instanceName string
    Name of the instances to be queried.
    projectId number
    The project CVM belongs to.
    resultOutputFile string
    Used to save results.
    subnetId string
    ID of a vpc subnetwork.
    tags {[key: string]: string}
    Tags of the instance.
    vpcId string
    ID of the vpc to be queried.
    availability_zone str
    The available zone that the CVM instance locates at.
    id str
    instance_id str
    ID of the instances to be queried.
    instance_name str
    Name of the instances to be queried.
    project_id float
    The project CVM belongs to.
    result_output_file str
    Used to save results.
    subnet_id str
    ID of a vpc subnetwork.
    tags Mapping[str, str]
    Tags of the instance.
    vpc_id str
    ID of the vpc to be queried.
    availabilityZone String
    The available zone that the CVM instance locates at.
    id String
    instanceId String
    ID of the instances to be queried.
    instanceName String
    Name of the instances to be queried.
    projectId Number
    The project CVM belongs to.
    resultOutputFile String
    Used to save results.
    subnetId String
    ID of a vpc subnetwork.
    tags Map<String>
    Tags of the instance.
    vpcId String
    ID of the vpc to be queried.

    getInstancesSet Result

    The following output properties are available:

    Id string
    InstanceLists List<GetInstancesSetInstanceList>
    An information list of cvm instance. Each element contains the following attributes:
    AvailabilityZone string
    The available zone that the CVM instance locates at.
    InstanceId string
    ID of the instances.
    InstanceName string
    Name of the instances.
    ProjectId double
    The project CVM belongs to.
    ResultOutputFile string
    SubnetId string
    ID of a vpc subnetwork.
    Tags Dictionary<string, string>
    Tags of the instance.
    VpcId string
    ID of the vpc.
    Id string
    InstanceLists []GetInstancesSetInstanceList
    An information list of cvm instance. Each element contains the following attributes:
    AvailabilityZone string
    The available zone that the CVM instance locates at.
    InstanceId string
    ID of the instances.
    InstanceName string
    Name of the instances.
    ProjectId float64
    The project CVM belongs to.
    ResultOutputFile string
    SubnetId string
    ID of a vpc subnetwork.
    Tags map[string]string
    Tags of the instance.
    VpcId string
    ID of the vpc.
    id String
    instanceLists List<GetInstancesSetInstanceList>
    An information list of cvm instance. Each element contains the following attributes:
    availabilityZone String
    The available zone that the CVM instance locates at.
    instanceId String
    ID of the instances.
    instanceName String
    Name of the instances.
    projectId Double
    The project CVM belongs to.
    resultOutputFile String
    subnetId String
    ID of a vpc subnetwork.
    tags Map<String,String>
    Tags of the instance.
    vpcId String
    ID of the vpc.
    id string
    instanceLists GetInstancesSetInstanceList[]
    An information list of cvm instance. Each element contains the following attributes:
    availabilityZone string
    The available zone that the CVM instance locates at.
    instanceId string
    ID of the instances.
    instanceName string
    Name of the instances.
    projectId number
    The project CVM belongs to.
    resultOutputFile string
    subnetId string
    ID of a vpc subnetwork.
    tags {[key: string]: string}
    Tags of the instance.
    vpcId string
    ID of the vpc.
    id str
    instance_lists Sequence[GetInstancesSetInstanceList]
    An information list of cvm instance. Each element contains the following attributes:
    availability_zone str
    The available zone that the CVM instance locates at.
    instance_id str
    ID of the instances.
    instance_name str
    Name of the instances.
    project_id float
    The project CVM belongs to.
    result_output_file str
    subnet_id str
    ID of a vpc subnetwork.
    tags Mapping[str, str]
    Tags of the instance.
    vpc_id str
    ID of the vpc.
    id String
    instanceLists List<Property Map>
    An information list of cvm instance. Each element contains the following attributes:
    availabilityZone String
    The available zone that the CVM instance locates at.
    instanceId String
    ID of the instances.
    instanceName String
    Name of the instances.
    projectId Number
    The project CVM belongs to.
    resultOutputFile String
    subnetId String
    ID of a vpc subnetwork.
    tags Map<String>
    Tags of the instance.
    vpcId String
    ID of the vpc.

    Supporting Types

    GetInstancesSetInstanceList

    AllocatePublicIp bool
    Indicates whether public ip is assigned.
    AvailabilityZone string
    The available zone that the CVM instance locates at.
    CamRoleName string
    CAM role name authorized to access.
    Cpu double
    The number of CPU cores of the instance.
    CreateTime string
    Creation time of the instance.
    DataDisks List<GetInstancesSetInstanceListDataDisk>
    An information list of data disk. Each element contains the following attributes:
    ExpiredTime string
    Expired time of the instance.
    ImageId string
    ID of the image.
    InstanceChargeType string
    The charge type of the instance.
    InstanceChargeTypePrepaidRenewFlag string
    The way that CVM instance will be renew automatically or not when it reach the end of the prepaid tenancy.
    InstanceId string
    ID of the instances to be queried.
    InstanceName string
    Name of the instances to be queried.
    InstanceType string
    Type of the instance.
    InternetChargeType string
    The charge type of the instance.
    InternetMaxBandwidthOut double
    Public network maximum output bandwidth of the instance.
    Memory double
    Instance memory capacity, unit in GB.
    PrivateIp string
    Private IP of the instance.
    ProjectId double
    The project CVM belongs to.
    PublicIp string
    Public IP of the instance.
    SecurityGroups List<string>
    Security groups of the instance.
    Status string
    Status of the instance.
    SubnetId string
    ID of a vpc subnetwork.
    SystemDiskId string
    Image ID of the system disk.
    SystemDiskSize double
    Size of the system disk.
    SystemDiskType string
    Type of the system disk.
    Tags Dictionary<string, string>
    Tags of the instance.
    VpcId string
    ID of the vpc to be queried.
    AllocatePublicIp bool
    Indicates whether public ip is assigned.
    AvailabilityZone string
    The available zone that the CVM instance locates at.
    CamRoleName string
    CAM role name authorized to access.
    Cpu float64
    The number of CPU cores of the instance.
    CreateTime string
    Creation time of the instance.
    DataDisks []GetInstancesSetInstanceListDataDisk
    An information list of data disk. Each element contains the following attributes:
    ExpiredTime string
    Expired time of the instance.
    ImageId string
    ID of the image.
    InstanceChargeType string
    The charge type of the instance.
    InstanceChargeTypePrepaidRenewFlag string
    The way that CVM instance will be renew automatically or not when it reach the end of the prepaid tenancy.
    InstanceId string
    ID of the instances to be queried.
    InstanceName string
    Name of the instances to be queried.
    InstanceType string
    Type of the instance.
    InternetChargeType string
    The charge type of the instance.
    InternetMaxBandwidthOut float64
    Public network maximum output bandwidth of the instance.
    Memory float64
    Instance memory capacity, unit in GB.
    PrivateIp string
    Private IP of the instance.
    ProjectId float64
    The project CVM belongs to.
    PublicIp string
    Public IP of the instance.
    SecurityGroups []string
    Security groups of the instance.
    Status string
    Status of the instance.
    SubnetId string
    ID of a vpc subnetwork.
    SystemDiskId string
    Image ID of the system disk.
    SystemDiskSize float64
    Size of the system disk.
    SystemDiskType string
    Type of the system disk.
    Tags map[string]string
    Tags of the instance.
    VpcId string
    ID of the vpc to be queried.
    allocatePublicIp Boolean
    Indicates whether public ip is assigned.
    availabilityZone String
    The available zone that the CVM instance locates at.
    camRoleName String
    CAM role name authorized to access.
    cpu Double
    The number of CPU cores of the instance.
    createTime String
    Creation time of the instance.
    dataDisks List<GetInstancesSetInstanceListDataDisk>
    An information list of data disk. Each element contains the following attributes:
    expiredTime String
    Expired time of the instance.
    imageId String
    ID of the image.
    instanceChargeType String
    The charge type of the instance.
    instanceChargeTypePrepaidRenewFlag String
    The way that CVM instance will be renew automatically or not when it reach the end of the prepaid tenancy.
    instanceId String
    ID of the instances to be queried.
    instanceName String
    Name of the instances to be queried.
    instanceType String
    Type of the instance.
    internetChargeType String
    The charge type of the instance.
    internetMaxBandwidthOut Double
    Public network maximum output bandwidth of the instance.
    memory Double
    Instance memory capacity, unit in GB.
    privateIp String
    Private IP of the instance.
    projectId Double
    The project CVM belongs to.
    publicIp String
    Public IP of the instance.
    securityGroups List<String>
    Security groups of the instance.
    status String
    Status of the instance.
    subnetId String
    ID of a vpc subnetwork.
    systemDiskId String
    Image ID of the system disk.
    systemDiskSize Double
    Size of the system disk.
    systemDiskType String
    Type of the system disk.
    tags Map<String,String>
    Tags of the instance.
    vpcId String
    ID of the vpc to be queried.
    allocatePublicIp boolean
    Indicates whether public ip is assigned.
    availabilityZone string
    The available zone that the CVM instance locates at.
    camRoleName string
    CAM role name authorized to access.
    cpu number
    The number of CPU cores of the instance.
    createTime string
    Creation time of the instance.
    dataDisks GetInstancesSetInstanceListDataDisk[]
    An information list of data disk. Each element contains the following attributes:
    expiredTime string
    Expired time of the instance.
    imageId string
    ID of the image.
    instanceChargeType string
    The charge type of the instance.
    instanceChargeTypePrepaidRenewFlag string
    The way that CVM instance will be renew automatically or not when it reach the end of the prepaid tenancy.
    instanceId string
    ID of the instances to be queried.
    instanceName string
    Name of the instances to be queried.
    instanceType string
    Type of the instance.
    internetChargeType string
    The charge type of the instance.
    internetMaxBandwidthOut number
    Public network maximum output bandwidth of the instance.
    memory number
    Instance memory capacity, unit in GB.
    privateIp string
    Private IP of the instance.
    projectId number
    The project CVM belongs to.
    publicIp string
    Public IP of the instance.
    securityGroups string[]
    Security groups of the instance.
    status string
    Status of the instance.
    subnetId string
    ID of a vpc subnetwork.
    systemDiskId string
    Image ID of the system disk.
    systemDiskSize number
    Size of the system disk.
    systemDiskType string
    Type of the system disk.
    tags {[key: string]: string}
    Tags of the instance.
    vpcId string
    ID of the vpc to be queried.
    allocate_public_ip bool
    Indicates whether public ip is assigned.
    availability_zone str
    The available zone that the CVM instance locates at.
    cam_role_name str
    CAM role name authorized to access.
    cpu float
    The number of CPU cores of the instance.
    create_time str
    Creation time of the instance.
    data_disks Sequence[GetInstancesSetInstanceListDataDisk]
    An information list of data disk. Each element contains the following attributes:
    expired_time str
    Expired time of the instance.
    image_id str
    ID of the image.
    instance_charge_type str
    The charge type of the instance.
    instance_charge_type_prepaid_renew_flag str
    The way that CVM instance will be renew automatically or not when it reach the end of the prepaid tenancy.
    instance_id str
    ID of the instances to be queried.
    instance_name str
    Name of the instances to be queried.
    instance_type str
    Type of the instance.
    internet_charge_type str
    The charge type of the instance.
    internet_max_bandwidth_out float
    Public network maximum output bandwidth of the instance.
    memory float
    Instance memory capacity, unit in GB.
    private_ip str
    Private IP of the instance.
    project_id float
    The project CVM belongs to.
    public_ip str
    Public IP of the instance.
    security_groups Sequence[str]
    Security groups of the instance.
    status str
    Status of the instance.
    subnet_id str
    ID of a vpc subnetwork.
    system_disk_id str
    Image ID of the system disk.
    system_disk_size float
    Size of the system disk.
    system_disk_type str
    Type of the system disk.
    tags Mapping[str, str]
    Tags of the instance.
    vpc_id str
    ID of the vpc to be queried.
    allocatePublicIp Boolean
    Indicates whether public ip is assigned.
    availabilityZone String
    The available zone that the CVM instance locates at.
    camRoleName String
    CAM role name authorized to access.
    cpu Number
    The number of CPU cores of the instance.
    createTime String
    Creation time of the instance.
    dataDisks List<Property Map>
    An information list of data disk. Each element contains the following attributes:
    expiredTime String
    Expired time of the instance.
    imageId String
    ID of the image.
    instanceChargeType String
    The charge type of the instance.
    instanceChargeTypePrepaidRenewFlag String
    The way that CVM instance will be renew automatically or not when it reach the end of the prepaid tenancy.
    instanceId String
    ID of the instances to be queried.
    instanceName String
    Name of the instances to be queried.
    instanceType String
    Type of the instance.
    internetChargeType String
    The charge type of the instance.
    internetMaxBandwidthOut Number
    Public network maximum output bandwidth of the instance.
    memory Number
    Instance memory capacity, unit in GB.
    privateIp String
    Private IP of the instance.
    projectId Number
    The project CVM belongs to.
    publicIp String
    Public IP of the instance.
    securityGroups List<String>
    Security groups of the instance.
    status String
    Status of the instance.
    subnetId String
    ID of a vpc subnetwork.
    systemDiskId String
    Image ID of the system disk.
    systemDiskSize Number
    Size of the system disk.
    systemDiskType String
    Type of the system disk.
    tags Map<String>
    Tags of the instance.
    vpcId String
    ID of the vpc to be queried.

    GetInstancesSetInstanceListDataDisk

    DataDiskId string
    Image ID of the data disk.
    DataDiskSize double
    Size of the data disk.
    DataDiskType string
    Type of the data disk.
    DeleteWithInstance bool
    Indicates whether the data disk is destroyed with the instance.
    DataDiskId string
    Image ID of the data disk.
    DataDiskSize float64
    Size of the data disk.
    DataDiskType string
    Type of the data disk.
    DeleteWithInstance bool
    Indicates whether the data disk is destroyed with the instance.
    dataDiskId String
    Image ID of the data disk.
    dataDiskSize Double
    Size of the data disk.
    dataDiskType String
    Type of the data disk.
    deleteWithInstance Boolean
    Indicates whether the data disk is destroyed with the instance.
    dataDiskId string
    Image ID of the data disk.
    dataDiskSize number
    Size of the data disk.
    dataDiskType string
    Type of the data disk.
    deleteWithInstance boolean
    Indicates whether the data disk is destroyed with the instance.
    data_disk_id str
    Image ID of the data disk.
    data_disk_size float
    Size of the data disk.
    data_disk_type str
    Type of the data disk.
    delete_with_instance bool
    Indicates whether the data disk is destroyed with the instance.
    dataDiskId String
    Image ID of the data disk.
    dataDiskSize Number
    Size of the data disk.
    dataDiskType String
    Type of the data disk.
    deleteWithInstance Boolean
    Indicates whether the data disk is destroyed with the 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