aws logo
AWS Classic v5.41.0, May 15 23

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 the aws.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:

VpcId string

VPC ID that you want to filter from.

Filters List<Pulumi.Aws.Ec2.Inputs.GetSubnetIdsFilter>

Custom filter block as described below.

Tags Dictionary<string, string>

Map of tags, each pair of which must exactly match a pair on the desired subnets.

VpcId string

VPC ID that you want to filter from.

Filters []GetSubnetIdsFilter

Custom filter block as described below.

Tags map[string]string

Map of tags, each pair of which must exactly match a pair on the desired subnets.

vpcId String

VPC ID that you want to filter from.

filters List<GetSubnetIdsFilter>

Custom filter block as described below.

tags Map<String,String>

Map of tags, each pair of which must exactly match a pair on the desired subnets.

vpcId string

VPC ID that you want to filter from.

filters GetSubnetIdsFilter[]

Custom filter block as described below.

tags {[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[GetSubnetIdsFilter]

Custom filter block as described below.

tags Mapping[str, str]

Map of tags, each pair of which must exactly match a pair on the desired subnets.

vpcId String

VPC ID that you want to filter from.

filters List<Property Map>

Custom filter block as described below.

tags 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.

Tags Dictionary<string, string>
VpcId string
Filters List<Pulumi.Aws.Ec2.Outputs.GetSubnetIdsFilter>
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.

Tags map[string]string
VpcId string
Filters []GetSubnetIdsFilter
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.

tags Map<String,String>
vpcId String
filters List<GetSubnetIdsFilter>
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.

tags {[key: string]: string}
vpcId string
filters GetSubnetIdsFilter[]
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.

tags Mapping[str, str]
vpc_id str
filters Sequence[GetSubnetIdsFilter]
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.

tags Map<String>
vpcId 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.