GetNetworks
This data source provides VPCs available to the user.
Example Usage
using Pulumi;
using AliCloud = Pulumi.AliCloud;
class MyStack : Stack
{
public MyStack()
{
var vpcsDs = Output.Create(AliCloud.Vpc.GetNetworks.InvokeAsync(new AliCloud.Vpc.GetNetworksArgs
{
CidrBlock = "172.16.0.0/12",
NameRegex = "^foo",
Status = "Available",
}));
this.FirstVpcId = vpcsDs.Apply(vpcsDs => vpcsDs.Vpcs[0].Id);
}
[Output("firstVpcId")]
public Output<string> FirstVpcId { get; set; }
}
Coming soon!
import pulumi
import pulumi_alicloud as alicloud
vpcs_ds = alicloud.vpc.get_networks(cidr_block="172.16.0.0/12",
name_regex="^foo",
status="Available")
pulumi.export("firstVpcId", vpcs_ds.vpcs[0]["id"])import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const vpcsDs = pulumi.output(alicloud.vpc.getNetworks({
cidrBlock: "172.16.0.0/12",
nameRegex: "^foo",
status: "Available",
}, { async: true }));
export const firstVpcId = vpcsDs.vpcs[0].id;Using GetNetworks
function getNetworks(args: GetNetworksArgs, opts?: InvokeOptions): Promise<GetNetworksResult>function get_networks(cidr_block=None, ids=None, is_default=None, name_regex=None, output_file=None, resource_group_id=None, status=None, tags=None, vswitch_id=None, opts=None)func GetNetworks(ctx *Context, args *GetNetworksArgs, opts ...InvokeOption) (*GetNetworksResult, error)public static class GetNetworks {
public static Task<GetNetworksResult> InvokeAsync(GetNetworksArgs args, InvokeOptions? opts = null)
}The following arguments are supported:
- Cidr
Block string Filter results by a specific CIDR block. For example: “172.16.0.0/12”.
- Ids List<string>
A list of VPC IDs.
- Is
Default bool Indicate whether the VPC is the default one in the specified region.
- Name
Regex string A regex string to filter VPCs by name.
- Output
File string - Resource
Group stringId The Id of resource group which VPC belongs.
- Status string
Filter results by a specific status. Valid value are
PendingandAvailable.- Dictionary<string, object>
A mapping of tags to assign to the resource.
- Vswitch
Id string Filter results by the specified VSwitch.
- Cidr
Block string Filter results by a specific CIDR block. For example: “172.16.0.0/12”.
- Ids []string
A list of VPC IDs.
- Is
Default bool Indicate whether the VPC is the default one in the specified region.
- Name
Regex string A regex string to filter VPCs by name.
- Output
File string - Resource
Group stringId The Id of resource group which VPC belongs.
- Status string
Filter results by a specific status. Valid value are
PendingandAvailable.- map[string]interface{}
A mapping of tags to assign to the resource.
- Vswitch
Id string Filter results by the specified VSwitch.
- cidr
Block string Filter results by a specific CIDR block. For example: “172.16.0.0/12”.
- ids string[]
A list of VPC IDs.
- is
Default boolean Indicate whether the VPC is the default one in the specified region.
- name
Regex string A regex string to filter VPCs by name.
- output
File string - resource
Group stringId The Id of resource group which VPC belongs.
- status string
Filter results by a specific status. Valid value are
PendingandAvailable.- {[key: string]: any}
A mapping of tags to assign to the resource.
- vswitch
Id string Filter results by the specified VSwitch.
- cidr_
block str Filter results by a specific CIDR block. For example: “172.16.0.0/12”.
- ids List[str]
A list of VPC IDs.
- is_
default bool Indicate whether the VPC is the default one in the specified region.
- name_
regex str A regex string to filter VPCs by name.
- output_
file str - resource_
group_ strid The Id of resource group which VPC belongs.
- status str
Filter results by a specific status. Valid value are
PendingandAvailable.- Dict[str, Any]
A mapping of tags to assign to the resource.
- vswitch_
id str Filter results by the specified VSwitch.
GetNetworks Result
The following output properties are available:
- Id string
The provider-assigned unique ID for this managed resource.
- Ids List<string>
A list of VPC IDs.
- Names List<string>
A list of VPC names.
- Vpcs
List<Pulumi.
Ali Cloud. Vpc. Outputs. Get Networks Vpc> A list of VPCs. Each element contains the following attributes:
- Cidr
Block string CIDR block of the VPC.
- Is
Default bool Whether the VPC is the default VPC in the region.
- Name
Regex string - Output
File string - Resource
Group stringId - Status string
Status of the VPC.
- Dictionary<string, object>
A map of tags assigned to the VPC.
- Vswitch
Id string
- Id string
The provider-assigned unique ID for this managed resource.
- Ids []string
A list of VPC IDs.
- Names []string
A list of VPC names.
- Vpcs
[]Get
Networks Vpc A list of VPCs. Each element contains the following attributes:
- Cidr
Block string CIDR block of the VPC.
- Is
Default bool Whether the VPC is the default VPC in the region.
- Name
Regex string - Output
File string - Resource
Group stringId - Status string
Status of the VPC.
- map[string]interface{}
A map of tags assigned to the VPC.
- Vswitch
Id string
- id string
The provider-assigned unique ID for this managed resource.
- ids string[]
A list of VPC IDs.
- names string[]
A list of VPC names.
- vpcs
Get
Networks Vpc[] A list of VPCs. Each element contains the following attributes:
- cidr
Block string CIDR block of the VPC.
- is
Default boolean Whether the VPC is the default VPC in the region.
- name
Regex string - output
File string - resource
Group stringId - status string
Status of the VPC.
- {[key: string]: any}
A map of tags assigned to the VPC.
- vswitch
Id string
- id str
The provider-assigned unique ID for this managed resource.
- ids List[str]
A list of VPC IDs.
- names List[str]
A list of VPC names.
- vpcs
List[Get
Networks Vpc] A list of VPCs. Each element contains the following attributes:
- cidr_
block str CIDR block of the VPC.
- is_
default bool Whether the VPC is the default VPC in the region.
- name_
regex str - output_
file str - resource_
group_ strid - status str
Status of the VPC.
- Dict[str, Any]
A map of tags assigned to the VPC.
- vswitch_
id str
Supporting Types
GetNetworksVpc
See the output API doc for this type.
See the output API doc for this type.
See the output API doc for this type.
- Cidr
Block string Filter results by a specific CIDR block. For example: “172.16.0.0/12”.
- Creation
Time string Time of creation.
- Description string
Description of the VPC
- Id string
ID of the VPC.
- Is
Default bool Indicate whether the VPC is the default one in the specified region.
- Region
Id string ID of the region where the VPC is located.
- Route
Table stringId Route table ID of the VRouter.
- Status string
Filter results by a specific status. Valid value are
PendingandAvailable.- Dictionary<string, object>
A mapping of tags to assign to the resource.
- Vpc
Name string Name of the VPC.
- Vrouter
Id string ID of the VRouter.
- Vswitch
Ids List<string> List of VSwitch IDs in the specified VPC
- Cidr
Block string Filter results by a specific CIDR block. For example: “172.16.0.0/12”.
- Creation
Time string Time of creation.
- Description string
Description of the VPC
- Id string
ID of the VPC.
- Is
Default bool Indicate whether the VPC is the default one in the specified region.
- Region
Id string ID of the region where the VPC is located.
- Route
Table stringId Route table ID of the VRouter.
- Status string
Filter results by a specific status. Valid value are
PendingandAvailable.- map[string]interface{}
A mapping of tags to assign to the resource.
- Vpc
Name string Name of the VPC.
- Vrouter
Id string ID of the VRouter.
- Vswitch
Ids []string List of VSwitch IDs in the specified VPC
- cidr
Block string Filter results by a specific CIDR block. For example: “172.16.0.0/12”.
- creation
Time string Time of creation.
- description string
Description of the VPC
- id string
ID of the VPC.
- is
Default boolean Indicate whether the VPC is the default one in the specified region.
- region
Id string ID of the region where the VPC is located.
- route
Table stringId Route table ID of the VRouter.
- status string
Filter results by a specific status. Valid value are
PendingandAvailable.- {[key: string]: any}
A mapping of tags to assign to the resource.
- vpc
Name string Name of the VPC.
- vrouter
Id string ID of the VRouter.
- vswitch
Ids string[] List of VSwitch IDs in the specified VPC
- cidr_
block str Filter results by a specific CIDR block. For example: “172.16.0.0/12”.
- creation_
time str Time of creation.
- description str
Description of the VPC
- id str
ID of the VPC.
- is_
default bool Indicate whether the VPC is the default one in the specified region.
- region
Id str ID of the region where the VPC is located.
- route_
table_ strid Route table ID of the VRouter.
- status str
Filter results by a specific status. Valid value are
PendingandAvailable.- Dict[str, Any]
A mapping of tags to assign to the resource.
- vpc_
name str Name of the VPC.
- vrouter
Id str ID of the VRouter.
- vswitch_
ids List[str] List of VSwitch IDs in the specified VPC
Package Details
- Repository
- https://github.com/pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloudTerraform Provider.