title: "getSubnetIds" title_tag: "huaweicloud.Vpc.getSubnetIds" meta_desc: "Documentation for the huaweicloud.Vpc.getSubnetIds function with examples, input properties, output properties, and supporting types." layout: api no_edit_this_page: true


Provides a list of subnet ids for a vpc.

This resource can be useful for getting back a list of subnet ids for a vpc.

Using getSubnetIds {#using}

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 getSubnetIds(args: GetSubnetIdsArgs, opts?: InvokeOptions): Promise<GetSubnetIdsResult>
function getSubnetIdsOutput(args: GetSubnetIdsOutputArgs, opts?: InvokeOptions): Output<GetSubnetIdsResult>
def get_subnet_ids(region: Optional[str] = None,
                   vpc_id: Optional[str] = None,
                   opts: Optional[InvokeOptions] = None) -> GetSubnetIdsResult
def get_subnet_ids_output(region: Optional[pulumi.Input[str]] = None,
                   vpc_id: Optional[pulumi.Input[str]] = None,
                   opts: Optional[InvokeOptions] = None) -> Output[GetSubnetIdsResult]
func GetSubnetIds(ctx *Context, args *GetSubnetIdsArgs, opts ...InvokeOption) (*GetSubnetIdsResult, error)
func GetSubnetIdsOutput(ctx *Context, args *GetSubnetIdsOutputArgs, opts ...InvokeOption) GetSubnetIdsResultOutput

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

public static class GetSubnetIds 
{
    public static Task<GetSubnetIdsResult> InvokeAsync(GetSubnetIdsArgs args, InvokeOptions? opts = null)
    public static Output<GetSubnetIdsResult> Invoke(GetSubnetIdsInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetSubnetIdsResult> getSubnetIds(GetSubnetIdsArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: huaweicloud:Vpc/getSubnetIds:getSubnetIds
  Arguments:
    # Arguments dictionary

The following arguments are supported:

VpcId string

Specifies the VPC ID used as the query filter.

Region string

The region in which to obtain the subnet ids. If omitted, the provider-level region will be used.

VpcId string

Specifies the VPC ID used as the query filter.

Region string

The region in which to obtain the subnet ids. If omitted, the provider-level region will be used.

vpcId String

Specifies the VPC ID used as the query filter.

region String

The region in which to obtain the subnet ids. If omitted, the provider-level region will be used.

vpcId string

Specifies the VPC ID used as the query filter.

region string

The region in which to obtain the subnet ids. If omitted, the provider-level region will be used.

vpc_id str

Specifies the VPC ID used as the query filter.

region str

The region in which to obtain the subnet ids. If omitted, the provider-level region will be used.

vpcId String

Specifies the VPC ID used as the query filter.

region String

The region in which to obtain the subnet ids. If omitted, the provider-level region will be used.

getSubnetIds Result {#result}

The following output properties are available:

Id string

The provider-assigned unique ID for this managed resource.

Ids List<string>

A set of all the subnet ids found. This data source will fail if none are found.

Region string
VpcId string
Id string

The provider-assigned unique ID for this managed resource.

Ids []string

A set of all the subnet ids found. This data source will fail if none are found.

Region string
VpcId string
id String

The provider-assigned unique ID for this managed resource.

ids List<String>

A set of all the subnet ids found. This data source will fail if none are found.

region String
vpcId String
id string

The provider-assigned unique ID for this managed resource.

ids string[]

A set of all the subnet ids found. This data source will fail if none are found.

region string
vpcId string
id str

The provider-assigned unique ID for this managed resource.

ids Sequence[str]

A set of all the subnet ids found. This data source will fail if none are found.

region str
vpc_id str
id String

The provider-assigned unique ID for this managed resource.

ids List<String>

A set of all the subnet ids found. This data source will fail if none are found.

region String
vpcId String

Package Details

Repository
https://github.com/huaweicloud/pulumi-huaweicloud
License
Apache-2.0
Notes

This Pulumi package is based on the huaweicloud Terraform Provider.