tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack
tencentcloud.getVpcInstances
Explore with Pulumi AI
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:
- Cidr
Block string - Filter VPC with this CIDR.
- Id string
- Is
Default bool - Filter default or no default VPC.
- Name string
- Name of the VPC to be queried.
- Result
Output stringFile - Used to save results.
- Tag
Key string - Filter if VPC has this tag.
- Dictionary<string, string>
- Tags of the VPC to be queried.
- Vpc
Id string - ID of the VPC to be queried.
- Cidr
Block string - Filter VPC with this CIDR.
- Id string
- Is
Default bool - Filter default or no default VPC.
- Name string
- Name of the VPC to be queried.
- Result
Output stringFile - Used to save results.
- Tag
Key string - Filter if VPC has this tag.
- map[string]string
- Tags of the VPC to be queried.
- Vpc
Id string - ID of the VPC to be queried.
- cidr
Block String - Filter VPC with this CIDR.
- id String
- is
Default Boolean - Filter default or no default VPC.
- name String
- Name of the VPC to be queried.
- result
Output StringFile - Used to save results.
- tag
Key String - Filter if VPC has this tag.
- Map<String,String>
- Tags of the VPC to be queried.
- vpc
Id String - ID of the VPC to be queried.
- cidr
Block string - Filter VPC with this CIDR.
- id string
- is
Default boolean - Filter default or no default VPC.
- name string
- Name of the VPC to be queried.
- result
Output stringFile - Used to save results.
- tag
Key string - Filter if VPC has this tag.
- {[key: string]: string}
- Tags of the VPC to be queried.
- vpc
Id 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_ strfile - Used to save results.
- tag_
key str - Filter if VPC has this tag.
- Mapping[str, str]
- Tags of the VPC to be queried.
- vpc_
id str - ID of the VPC to be queried.
- cidr
Block String - Filter VPC with this CIDR.
- id String
- is
Default Boolean - Filter default or no default VPC.
- name String
- Name of the VPC to be queried.
- result
Output StringFile - Used to save results.
- tag
Key String - Filter if VPC has this tag.
- Map<String>
- Tags of the VPC to be queried.
- vpc
Id String - ID of the VPC to be queried.
getVpcInstances Result
The following output properties are available:
- Id string
- Instance
Lists List<GetVpc Instances Instance List> - The information list of the VPC.
- Cidr
Block string - A network address block of a VPC CIDR.
- Is
Default bool - Indicates whether it is the default VPC for this region.
- Name string
- Name of the VPC.
- Result
Output stringFile - Tag
Key string - Dictionary<string, string>
- Tags of the VPC.
- Vpc
Id string - ID of the VPC.
- Id string
- Instance
Lists []GetVpc Instances Instance List - The information list of the VPC.
- Cidr
Block string - A network address block of a VPC CIDR.
- Is
Default bool - Indicates whether it is the default VPC for this region.
- Name string
- Name of the VPC.
- Result
Output stringFile - Tag
Key string - map[string]string
- Tags of the VPC.
- Vpc
Id string - ID of the VPC.
- id String
- instance
Lists List<GetVpc Instances Instance List> - The information list of the VPC.
- cidr
Block String - A network address block of a VPC CIDR.
- is
Default Boolean - Indicates whether it is the default VPC for this region.
- name String
- Name of the VPC.
- result
Output StringFile - tag
Key String - Map<String,String>
- Tags of the VPC.
- vpc
Id String - ID of the VPC.
- id string
- instance
Lists GetVpc Instances Instance List[] - The information list of the VPC.
- cidr
Block string - A network address block of a VPC CIDR.
- is
Default boolean - Indicates whether it is the default VPC for this region.
- name string
- Name of the VPC.
- result
Output stringFile - tag
Key string - {[key: string]: string}
- Tags of the VPC.
- vpc
Id string - ID of the VPC.
- id str
- instance_
lists Sequence[GetVpc Instances Instance List] - 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_ strfile - tag_
key str - Mapping[str, str]
- Tags of the VPC.
- vpc_
id str - ID of the VPC.
- id String
- instance
Lists List<Property Map> - The information list of the VPC.
- cidr
Block String - A network address block of a VPC CIDR.
- is
Default Boolean - Indicates whether it is the default VPC for this region.
- name String
- Name of the VPC.
- result
Output StringFile - tag
Key String - Map<String>
- Tags of the VPC.
- vpc
Id String - ID of the VPC.
Supporting Types
GetVpcInstancesInstanceList
- Cidr
Block string - Filter VPC with this CIDR.
- Common
Assistant List<string>Cidrs - common assistant CIDR block.
- Container
Assistant List<string>Cidrs - container assistant CIDR block.
- Create
Time string - Creation time of VPC.
- Dns
Servers List<string> - 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 string
- Name of the VPC to be queried.
- Subnet
Ids List<string> - A ID list of subnets within this VPC.
- Dictionary<string, string>
- Tags of the VPC to be queried.
- Vpc
Id string - ID of the VPC to be queried.
- Cidr
Block string - Filter VPC with this CIDR.
- Common
Assistant []stringCidrs - common assistant CIDR block.
- Container
Assistant []stringCidrs - container assistant CIDR block.
- Create
Time string - Creation time of VPC.
- Dns
Servers []string - 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 string
- Name of the VPC to be queried.
- Subnet
Ids []string - A ID list of subnets within this VPC.
- map[string]string
- Tags of the VPC to be queried.
- Vpc
Id string - ID of the VPC to be queried.
- cidr
Block String - Filter VPC with this CIDR.
- common
Assistant List<String>Cidrs - common assistant CIDR block.
- container
Assistant List<String>Cidrs - container assistant CIDR block.
- create
Time String - Creation time of VPC.
- dns
Servers List<String> - A list of DNS servers which can be used within the VPC.
- is
Default Boolean - Filter default or no default VPC.
- is
Multicast Boolean - Indicates whether VPC multicast is enabled.
- name String
- Name of the VPC to be queried.
- subnet
Ids List<String> - A ID list of subnets within this VPC.
- Map<String,String>
- Tags of the VPC to be queried.
- vpc
Id String - ID of the VPC to be queried.
- cidr
Block string - Filter VPC with this CIDR.
- common
Assistant string[]Cidrs - common assistant CIDR block.
- container
Assistant string[]Cidrs - container assistant CIDR block.
- create
Time string - Creation time of VPC.
- dns
Servers string[] - A list of DNS servers which can be used within the VPC.
- is
Default boolean - Filter default or no default VPC.
- is
Multicast boolean - Indicates whether VPC multicast is enabled.
- name string
- Name of the VPC to be queried.
- subnet
Ids string[] - A ID list of subnets within this VPC.
- {[key: string]: string}
- Tags of the VPC to be queried.
- vpc
Id string - ID of the VPC to be queried.
- cidr_
block str - Filter VPC with this CIDR.
- common_
assistant_ Sequence[str]cidrs - common assistant CIDR block.
- container_
assistant_ Sequence[str]cidrs - 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.
- Mapping[str, str]
- Tags of the VPC to be queried.
- vpc_
id str - ID of the VPC to be queried.
- cidr
Block String - Filter VPC with this CIDR.
- common
Assistant List<String>Cidrs - common assistant CIDR block.
- container
Assistant List<String>Cidrs - container assistant CIDR block.
- create
Time String - Creation time of VPC.
- dns
Servers List<String> - A list of DNS servers which can be used within the VPC.
- is
Default Boolean - Filter default or no default VPC.
- is
Multicast Boolean - Indicates whether VPC multicast is enabled.
- name String
- Name of the VPC to be queried.
- subnet
Ids List<String> - A ID list of subnets within this VPC.
- Map<String>
- Tags of the VPC to be queried.
- vpc
Id 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 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack