aws.ec2.getSubnetIds
Explore with Pulumi AI
aws.ec2.getSubnetIds
provides a set of ids for a vpc_id
This resource can be useful for getting back a set of subnet ids for a vpc.
NOTE: The
aws.ec2.getSubnetIds
data source has been deprecated and will be removed in a future version. Use theaws.ec2.getSubnets
data source instead.
Using getSubnetIds
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(filters: Optional[Sequence[GetSubnetIdsFilter]] = None,
tags: Optional[Mapping[str, str]] = None,
vpc_id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetSubnetIdsResult
def get_subnet_ids_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetSubnetIdsFilterArgs]]]] = None,
tags: Optional[pulumi.Input[Mapping[str, 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: aws:ec2/getSubnetIds:getSubnetIds
arguments:
# arguments dictionary
The following arguments are supported:
- Vpc
Id string VPC ID that you want to filter from.
- Filters
List<Pulumi.
Aws. Ec2. Inputs. Get Subnet Ids Filter> Custom filter block as described below.
- Dictionary<string, string>
Map of tags, each pair of which must exactly match a pair on the desired subnets.
- Vpc
Id string VPC ID that you want to filter from.
- Filters
[]Get
Subnet Ids Filter Custom filter block as described below.
- map[string]string
Map of tags, each pair of which must exactly match a pair on the desired subnets.
- vpc
Id String VPC ID that you want to filter from.
- filters
List<Get
Subnet Ids Filter> Custom filter block as described below.
- Map<String,String>
Map of tags, each pair of which must exactly match a pair on the desired subnets.
- vpc
Id string VPC ID that you want to filter from.
- filters
Get
Subnet Ids Filter[] Custom filter block as described below.
- {[key: string]: string}
Map of tags, each pair of which must exactly match a pair on the desired subnets.
- vpc_
id str VPC ID that you want to filter from.
- filters
Sequence[Get
Subnet Ids Filter] Custom filter block as described below.
- Mapping[str, str]
Map of tags, each pair of which must exactly match a pair on the desired subnets.
- vpc
Id String VPC ID that you want to filter from.
- filters List<Property Map>
Custom filter block as described below.
- Map<String>
Map of tags, each pair of which must exactly match a pair on the desired subnets.
getSubnetIds Result
The following output properties are available:
- Id string
The provider-assigned unique ID for this managed resource.
- Ids List<string>
Set of all the subnet ids found. This data source will fail if none are found.
- Dictionary<string, string>
- Vpc
Id string - Filters
List<Pulumi.
Aws. Ec2. Outputs. Get Subnet Ids Filter>
- Id string
The provider-assigned unique ID for this managed resource.
- Ids []string
Set of all the subnet ids found. This data source will fail if none are found.
- map[string]string
- Vpc
Id string - Filters
[]Get
Subnet Ids Filter
- id String
The provider-assigned unique ID for this managed resource.
- ids List<String>
Set of all the subnet ids found. This data source will fail if none are found.
- Map<String,String>
- vpc
Id String - filters
List<Get
Subnet Ids Filter>
- id string
The provider-assigned unique ID for this managed resource.
- ids string[]
Set of all the subnet ids found. This data source will fail if none are found.
- {[key: string]: string}
- vpc
Id string - filters
Get
Subnet Ids Filter[]
- id str
The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
Set of all the subnet ids found. This data source will fail if none are found.
- Mapping[str, str]
- vpc_
id str - filters
Sequence[Get
Subnet Ids Filter]
- id String
The provider-assigned unique ID for this managed resource.
- ids List<String>
Set of all the subnet ids found. This data source will fail if none are found.
- Map<String>
- vpc
Id String - filters List<Property Map>
Supporting Types
GetSubnetIdsFilter
- Name string
Name of the field to filter by, as defined by the underlying AWS API. For example, if matching against tag
Name
, use:- Values List<string>
Set of values that are accepted for the given field. Subnet IDs will be selected if any one of the given values match.
- Name string
Name of the field to filter by, as defined by the underlying AWS API. For example, if matching against tag
Name
, use:- Values []string
Set of values that are accepted for the given field. Subnet IDs will be selected if any one of the given values match.
- name String
Name of the field to filter by, as defined by the underlying AWS API. For example, if matching against tag
Name
, use:- values List<String>
Set of values that are accepted for the given field. Subnet IDs will be selected if any one of the given values match.
- name string
Name of the field to filter by, as defined by the underlying AWS API. For example, if matching against tag
Name
, use:- values string[]
Set of values that are accepted for the given field. Subnet IDs will be selected if any one of the given values match.
- name str
Name of the field to filter by, as defined by the underlying AWS API. For example, if matching against tag
Name
, use:- values Sequence[str]
Set of values that are accepted for the given field. Subnet IDs will be selected if any one of the given values match.
- name String
Name of the field to filter by, as defined by the underlying AWS API. For example, if matching against tag
Name
, use:- values List<String>
Set of values that are accepted for the given field. Subnet IDs will be selected if any one of the given values match.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
aws
Terraform Provider.