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

tencentcloud.getVpcInstances

Explore with Pulumi AI

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

    Use this data source to query vpc instances’ information.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const foo = new tencentcloud.Vpc("foo", {cidrBlock: "10.0.0.0/16"});
    const idInstances = tencentcloud.getVpcInstancesOutput({
        vpcId: foo.vpcId,
    });
    const nameInstances = tencentcloud.getVpcInstancesOutput({
        name: foo.name,
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    foo = tencentcloud.Vpc("foo", cidr_block="10.0.0.0/16")
    id_instances = tencentcloud.get_vpc_instances_output(vpc_id=foo.vpc_id)
    name_instances = tencentcloud.get_vpc_instances_output(name=foo.name)
    
    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 {
    		foo, err := tencentcloud.NewVpc(ctx, "foo", &tencentcloud.VpcArgs{
    			CidrBlock: pulumi.String("10.0.0.0/16"),
    		})
    		if err != nil {
    			return err
    		}
    		_ = tencentcloud.GetVpcInstancesOutput(ctx, tencentcloud.GetVpcInstancesOutputArgs{
    			VpcId: foo.VpcId,
    		}, nil)
    		_ = tencentcloud.GetVpcInstancesOutput(ctx, tencentcloud.GetVpcInstancesOutputArgs{
    			Name: foo.Name,
    		}, nil)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Tencentcloud = Pulumi.Tencentcloud;
    
    return await Deployment.RunAsync(() => 
    {
        var foo = new Tencentcloud.Vpc("foo", new()
        {
            CidrBlock = "10.0.0.0/16",
        });
    
        var idInstances = Tencentcloud.GetVpcInstances.Invoke(new()
        {
            VpcId = foo.VpcId,
        });
    
        var nameInstances = Tencentcloud.GetVpcInstances.Invoke(new()
        {
            Name = foo.Name,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.Vpc;
    import com.pulumi.tencentcloud.VpcArgs;
    import com.pulumi.tencentcloud.TencentcloudFunctions;
    import com.pulumi.tencentcloud.inputs.GetVpcInstancesArgs;
    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 foo = new Vpc("foo", VpcArgs.builder()
                .cidrBlock("10.0.0.0/16")
                .build());
    
            final var idInstances = TencentcloudFunctions.getVpcInstances(GetVpcInstancesArgs.builder()
                .vpcId(foo.vpcId())
                .build());
    
            final var nameInstances = TencentcloudFunctions.getVpcInstances(GetVpcInstancesArgs.builder()
                .name(foo.name())
                .build());
    
        }
    }
    
    resources:
      foo:
        type: tencentcloud:Vpc
        properties:
          cidrBlock: 10.0.0.0/16
    variables:
      idInstances:
        fn::invoke:
          function: tencentcloud:getVpcInstances
          arguments:
            vpcId: ${foo.vpcId}
      nameInstances:
        fn::invoke:
          function: tencentcloud:getVpcInstances
          arguments:
            name: ${foo.name}
    

    Using getVpcInstances

    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 getVpcInstances(args: GetVpcInstancesArgs, opts?: InvokeOptions): Promise<GetVpcInstancesResult>
    function getVpcInstancesOutput(args: GetVpcInstancesOutputArgs, opts?: InvokeOptions): Output<GetVpcInstancesResult>
    def get_vpc_instances(cidr_block: Optional[str] = None,
                          id: Optional[str] = None,
                          is_default: Optional[bool] = None,
                          name: Optional[str] = None,
                          result_output_file: Optional[str] = None,
                          tag_key: Optional[str] = None,
                          tags: Optional[Mapping[str, str]] = None,
                          vpc_id: Optional[str] = None,
                          opts: Optional[InvokeOptions] = None) -> GetVpcInstancesResult
    def get_vpc_instances_output(cidr_block: Optional[pulumi.Input[str]] = None,
                          id: Optional[pulumi.Input[str]] = None,
                          is_default: Optional[pulumi.Input[bool]] = None,
                          name: Optional[pulumi.Input[str]] = None,
                          result_output_file: Optional[pulumi.Input[str]] = None,
                          tag_key: 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[GetVpcInstancesResult]
    func GetVpcInstances(ctx *Context, args *GetVpcInstancesArgs, opts ...InvokeOption) (*GetVpcInstancesResult, error)
    func GetVpcInstancesOutput(ctx *Context, args *GetVpcInstancesOutputArgs, opts ...InvokeOption) GetVpcInstancesResultOutput

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

    public static class GetVpcInstances 
    {
        public static Task<GetVpcInstancesResult> InvokeAsync(GetVpcInstancesArgs args, InvokeOptions? opts = null)
        public static Output<GetVpcInstancesResult> Invoke(GetVpcInstancesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetVpcInstancesResult> getVpcInstances(GetVpcInstancesArgs args, InvokeOptions options)
    public static Output<GetVpcInstancesResult> getVpcInstances(GetVpcInstancesArgs args, InvokeOptions options)
    
    fn::invoke:
      function: tencentcloud:index/getVpcInstances:getVpcInstances
      arguments:
        # arguments dictionary

    The following arguments are supported:

    CidrBlock string
    Filter VPC with this CIDR.
    Id string
    IsDefault bool
    Filter default or no default VPC.
    Name string
    Name of the VPC to be queried.
    ResultOutputFile string
    Used to save results.
    TagKey string
    Filter if VPC has this tag.
    Tags Dictionary<string, string>
    Tags of the VPC to be queried.
    VpcId string
    ID of the VPC to be queried.
    CidrBlock string
    Filter VPC with this CIDR.
    Id string
    IsDefault bool
    Filter default or no default VPC.
    Name string
    Name of the VPC to be queried.
    ResultOutputFile string
    Used to save results.
    TagKey string
    Filter if VPC has this tag.
    Tags map[string]string
    Tags of the VPC to be queried.
    VpcId string
    ID of the VPC to be queried.
    cidrBlock String
    Filter VPC with this CIDR.
    id String
    isDefault Boolean
    Filter default or no default VPC.
    name String
    Name of the VPC to be queried.
    resultOutputFile String
    Used to save results.
    tagKey String
    Filter if VPC has this tag.
    tags Map<String,String>
    Tags of the VPC to be queried.
    vpcId String
    ID of the VPC to be queried.
    cidrBlock string
    Filter VPC with this CIDR.
    id string
    isDefault boolean
    Filter default or no default VPC.
    name string
    Name of the VPC to be queried.
    resultOutputFile string
    Used to save results.
    tagKey string
    Filter if VPC has this tag.
    tags {[key: string]: string}
    Tags of the VPC to be queried.
    vpcId string
    ID of the VPC to be queried.
    cidr_block str
    Filter VPC with this CIDR.
    id str
    is_default bool
    Filter default or no default VPC.
    name str
    Name of the VPC to be queried.
    result_output_file str
    Used to save results.
    tag_key str
    Filter if VPC has this tag.
    tags Mapping[str, str]
    Tags of the VPC to be queried.
    vpc_id str
    ID of the VPC to be queried.
    cidrBlock String
    Filter VPC with this CIDR.
    id String
    isDefault Boolean
    Filter default or no default VPC.
    name String
    Name of the VPC to be queried.
    resultOutputFile String
    Used to save results.
    tagKey String
    Filter if VPC has this tag.
    tags Map<String>
    Tags of the VPC to be queried.
    vpcId String
    ID of the VPC to be queried.

    getVpcInstances Result

    The following output properties are available:

    Id string
    InstanceLists List<GetVpcInstancesInstanceList>
    The information list of the VPC.
    CidrBlock string
    A network address block of a VPC CIDR.
    IsDefault bool
    Indicates whether it is the default VPC for this region.
    Name string
    Name of the VPC.
    ResultOutputFile string
    TagKey string
    Tags Dictionary<string, string>
    Tags of the VPC.
    VpcId string
    ID of the VPC.
    Id string
    InstanceLists []GetVpcInstancesInstanceList
    The information list of the VPC.
    CidrBlock string
    A network address block of a VPC CIDR.
    IsDefault bool
    Indicates whether it is the default VPC for this region.
    Name string
    Name of the VPC.
    ResultOutputFile string
    TagKey string
    Tags map[string]string
    Tags of the VPC.
    VpcId string
    ID of the VPC.
    id String
    instanceLists List<GetVpcInstancesInstanceList>
    The information list of the VPC.
    cidrBlock String
    A network address block of a VPC CIDR.
    isDefault Boolean
    Indicates whether it is the default VPC for this region.
    name String
    Name of the VPC.
    resultOutputFile String
    tagKey String
    tags Map<String,String>
    Tags of the VPC.
    vpcId String
    ID of the VPC.
    id string
    instanceLists GetVpcInstancesInstanceList[]
    The information list of the VPC.
    cidrBlock string
    A network address block of a VPC CIDR.
    isDefault boolean
    Indicates whether it is the default VPC for this region.
    name string
    Name of the VPC.
    resultOutputFile string
    tagKey string
    tags {[key: string]: string}
    Tags of the VPC.
    vpcId string
    ID of the VPC.
    id str
    instance_lists Sequence[GetVpcInstancesInstanceList]
    The information list of the VPC.
    cidr_block str
    A network address block of a VPC CIDR.
    is_default bool
    Indicates whether it is the default VPC for this region.
    name str
    Name of the VPC.
    result_output_file str
    tag_key str
    tags Mapping[str, str]
    Tags of the VPC.
    vpc_id str
    ID of the VPC.
    id String
    instanceLists List<Property Map>
    The information list of the VPC.
    cidrBlock String
    A network address block of a VPC CIDR.
    isDefault Boolean
    Indicates whether it is the default VPC for this region.
    name String
    Name of the VPC.
    resultOutputFile String
    tagKey String
    tags Map<String>
    Tags of the VPC.
    vpcId String
    ID of the VPC.

    Supporting Types

    GetVpcInstancesInstanceList

    CidrBlock string
    Filter VPC with this CIDR.
    CommonAssistantCidrs List<string>
    common assistant CIDR block.
    ContainerAssistantCidrs List<string>
    container assistant CIDR block.
    CreateTime string
    Creation time of VPC.
    DnsServers List<string>
    A list of DNS servers which can be used within the VPC.
    IsDefault bool
    Filter default or no default VPC.
    IsMulticast bool
    Indicates whether VPC multicast is enabled.
    Name string
    Name of the VPC to be queried.
    SubnetIds List<string>
    A ID list of subnets within this VPC.
    Tags Dictionary<string, string>
    Tags of the VPC to be queried.
    VpcId string
    ID of the VPC to be queried.
    CidrBlock string
    Filter VPC with this CIDR.
    CommonAssistantCidrs []string
    common assistant CIDR block.
    ContainerAssistantCidrs []string
    container assistant CIDR block.
    CreateTime string
    Creation time of VPC.
    DnsServers []string
    A list of DNS servers which can be used within the VPC.
    IsDefault bool
    Filter default or no default VPC.
    IsMulticast bool
    Indicates whether VPC multicast is enabled.
    Name string
    Name of the VPC to be queried.
    SubnetIds []string
    A ID list of subnets within this VPC.
    Tags map[string]string
    Tags of the VPC to be queried.
    VpcId string
    ID of the VPC to be queried.
    cidrBlock String
    Filter VPC with this CIDR.
    commonAssistantCidrs List<String>
    common assistant CIDR block.
    containerAssistantCidrs List<String>
    container assistant CIDR block.
    createTime String
    Creation time of VPC.
    dnsServers List<String>
    A list of DNS servers which can be used within the VPC.
    isDefault Boolean
    Filter default or no default VPC.
    isMulticast Boolean
    Indicates whether VPC multicast is enabled.
    name String
    Name of the VPC to be queried.
    subnetIds List<String>
    A ID list of subnets within this VPC.
    tags Map<String,String>
    Tags of the VPC to be queried.
    vpcId String
    ID of the VPC to be queried.
    cidrBlock string
    Filter VPC with this CIDR.
    commonAssistantCidrs string[]
    common assistant CIDR block.
    containerAssistantCidrs string[]
    container assistant CIDR block.
    createTime string
    Creation time of VPC.
    dnsServers string[]
    A list of DNS servers which can be used within the VPC.
    isDefault boolean
    Filter default or no default VPC.
    isMulticast boolean
    Indicates whether VPC multicast is enabled.
    name string
    Name of the VPC to be queried.
    subnetIds string[]
    A ID list of subnets within this VPC.
    tags {[key: string]: string}
    Tags of the VPC to be queried.
    vpcId string
    ID of the VPC to be queried.
    cidr_block str
    Filter VPC with this CIDR.
    common_assistant_cidrs Sequence[str]
    common assistant CIDR block.
    container_assistant_cidrs Sequence[str]
    container assistant CIDR block.
    create_time str
    Creation time of VPC.
    dns_servers Sequence[str]
    A list of DNS servers which can be used within the VPC.
    is_default bool
    Filter default or no default VPC.
    is_multicast bool
    Indicates whether VPC multicast is enabled.
    name str
    Name of the VPC to be queried.
    subnet_ids Sequence[str]
    A ID list of subnets within this VPC.
    tags Mapping[str, str]
    Tags of the VPC to be queried.
    vpc_id str
    ID of the VPC to be queried.
    cidrBlock String
    Filter VPC with this CIDR.
    commonAssistantCidrs List<String>
    common assistant CIDR block.
    containerAssistantCidrs List<String>
    container assistant CIDR block.
    createTime String
    Creation time of VPC.
    dnsServers List<String>
    A list of DNS servers which can be used within the VPC.
    isDefault Boolean
    Filter default or no default VPC.
    isMulticast Boolean
    Indicates whether VPC multicast is enabled.
    name String
    Name of the VPC to be queried.
    subnetIds List<String>
    A ID list of subnets within this VPC.
    tags Map<String>
    Tags of the VPC to be queried.
    vpcId String
    ID of the VPC to be queried.

    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