published on Tuesday, Mar 10, 2026 by Pulumi
published on Tuesday, Mar 10, 2026 by Pulumi
This resource can be useful for getting back a list of VPC Ids for a region.
The following example retrieves a list of VPC Ids with a custom tag of service set to a value of “production”.
Using getVpcs
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 getVpcs(args: GetVpcsArgs, opts?: InvokeOptions): Promise<GetVpcsResult>
function getVpcsOutput(args: GetVpcsOutputArgs, opts?: InvokeOptions): Output<GetVpcsResult>def get_vpcs(filters: Optional[Sequence[GetVpcsFilter]] = None,
tags: Optional[Mapping[str, str]] = None,
opts: Optional[InvokeOptions] = None) -> GetVpcsResult
def get_vpcs_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetVpcsFilterArgs]]]] = None,
tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetVpcsResult]func GetVpcs(ctx *Context, args *GetVpcsArgs, opts ...InvokeOption) (*GetVpcsResult, error)
func GetVpcsOutput(ctx *Context, args *GetVpcsOutputArgs, opts ...InvokeOption) GetVpcsResultOutput> Note: This function is named GetVpcs in the Go SDK.
public static class GetVpcs
{
public static Task<GetVpcsResult> InvokeAsync(GetVpcsArgs args, InvokeOptions? opts = null)
public static Output<GetVpcsResult> Invoke(GetVpcsInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetVpcsResult> getVpcs(GetVpcsArgs args, InvokeOptions options)
public static Output<GetVpcsResult> getVpcs(GetVpcsArgs args, InvokeOptions options)
fn::invoke:
function: aws:ec2/getVpcs:getVpcs
arguments:
# arguments dictionaryThe following arguments are supported:
- Filters
List<Get
Vpcs Filter> Custom filter block as described below.
More complex filters can be expressed using one or more
filtersub-blocks, which take the following arguments:- Dictionary<string, string>
- Map of tags, each pair of which must exactly match a pair on the desired vpcs.
- Filters
[]Get
Vpcs Filter Custom filter block as described below.
More complex filters can be expressed using one or more
filtersub-blocks, which take the following arguments:- map[string]string
- Map of tags, each pair of which must exactly match a pair on the desired vpcs.
- filters
List<Get
Vpcs Filter> Custom filter block as described below.
More complex filters can be expressed using one or more
filtersub-blocks, which take the following arguments:- Map<String,String>
- Map of tags, each pair of which must exactly match a pair on the desired vpcs.
- filters
Get
Vpcs Filter[] Custom filter block as described below.
More complex filters can be expressed using one or more
filtersub-blocks, which take the following arguments:- {[key: string]: string}
- Map of tags, each pair of which must exactly match a pair on the desired vpcs.
- filters
Sequence[Get
Vpcs Filter] Custom filter block as described below.
More complex filters can be expressed using one or more
filtersub-blocks, which take the following arguments:- Mapping[str, str]
- Map of tags, each pair of which must exactly match a pair on the desired vpcs.
- filters List<Property Map>
Custom filter block as described below.
More complex filters can be expressed using one or more
filtersub-blocks, which take the following arguments:- Map<String>
- Map of tags, each pair of which must exactly match a pair on the desired vpcs.
getVpcs Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids List<string>
- List of all the VPC Ids found.
- Dictionary<string, string>
- Filters
List<Get
Vpcs Filter>
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- List of all the VPC Ids found.
- map[string]string
- Filters
[]Get
Vpcs Filter
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- List of all the VPC Ids found.
- Map<String,String>
- filters
List<Get
Vpcs Filter>
- id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- List of all the VPC Ids found.
- {[key: string]: string}
- filters
Get
Vpcs Filter[]
- id str
- The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- List of all the VPC Ids found.
- Mapping[str, str]
- filters
Sequence[Get
Vpcs Filter]
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- List of all the VPC Ids found.
- Map<String>
- filters List<Property Map>
Supporting Types
GetVpcsFilter
- Name string
- Name of the field to filter by, as defined by the underlying AWS API.
- Values List<string>
- Set of values that are accepted for the given field. A VPC will be selected if any one of the given values matches.
- Name string
- Name of the field to filter by, as defined by the underlying AWS API.
- Values []string
- Set of values that are accepted for the given field. A VPC will be selected if any one of the given values matches.
- name String
- Name of the field to filter by, as defined by the underlying AWS API.
- values List<String>
- Set of values that are accepted for the given field. A VPC will be selected if any one of the given values matches.
- name string
- Name of the field to filter by, as defined by the underlying AWS API.
- values string[]
- Set of values that are accepted for the given field. A VPC will be selected if any one of the given values matches.
- name str
- Name of the field to filter by, as defined by the underlying AWS API.
- values Sequence[str]
- Set of values that are accepted for the given field. A VPC will be selected if any one of the given values matches.
- name String
- Name of the field to filter by, as defined by the underlying AWS API.
- values List<String>
- Set of values that are accepted for the given field. A VPC will be selected if any one of the given values matches.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
awsTerraform Provider.
published on Tuesday, Mar 10, 2026 by Pulumi