aws.ec2.getSubnet
Explore with Pulumi AI
aws.ec2.Subnet provides details about a specific VPC subnet.
This resource can prove useful when a module accepts a subnet ID as an input variable and needs to, for example, determine the ID of the VPC that the subnet belongs to.
Example Usage
The following example shows how one might accept a subnet ID as a variable and use this data source to obtain the data necessary to create a security group that allows connections from hosts in that subnet.
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const config = new pulumi.Config();
const subnetId = config.requireObject("subnetId");
const selected = aws.ec2.getSubnet({
    id: subnetId,
});
const subnetSecurityGroup = new aws.ec2.SecurityGroup("subnet_security_group", {
    vpcId: selected.then(selected => selected.vpcId),
    ingress: [{
        cidrBlocks: [selected.then(selected => selected.cidrBlock)],
        fromPort: 80,
        toPort: 80,
        protocol: "tcp",
    }],
});
import pulumi
import pulumi_aws as aws
config = pulumi.Config()
subnet_id = config.require_object("subnetId")
selected = aws.ec2.get_subnet(id=subnet_id)
subnet_security_group = aws.ec2.SecurityGroup("subnet_security_group",
    vpc_id=selected.vpc_id,
    ingress=[{
        "cidr_blocks": [selected.cidr_block],
        "from_port": 80,
        "to_port": 80,
        "protocol": "tcp",
    }])
package main
import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		cfg := config.New(ctx, "")
		subnetId := cfg.RequireObject("subnetId")
		selected, err := ec2.LookupSubnet(ctx, &ec2.LookupSubnetArgs{
			Id: pulumi.StringRef(subnetId),
		}, nil)
		if err != nil {
			return err
		}
		_, err = ec2.NewSecurityGroup(ctx, "subnet_security_group", &ec2.SecurityGroupArgs{
			VpcId: pulumi.String(selected.VpcId),
			Ingress: ec2.SecurityGroupIngressArray{
				&ec2.SecurityGroupIngressArgs{
					CidrBlocks: pulumi.StringArray{
						pulumi.String(selected.CidrBlock),
					},
					FromPort: pulumi.Int(80),
					ToPort:   pulumi.Int(80),
					Protocol: pulumi.String("tcp"),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() => 
{
    var config = new Config();
    var subnetId = config.RequireObject<dynamic>("subnetId");
    var selected = Aws.Ec2.GetSubnet.Invoke(new()
    {
        Id = subnetId,
    });
    var subnetSecurityGroup = new Aws.Ec2.SecurityGroup("subnet_security_group", new()
    {
        VpcId = selected.Apply(getSubnetResult => getSubnetResult.VpcId),
        Ingress = new[]
        {
            new Aws.Ec2.Inputs.SecurityGroupIngressArgs
            {
                CidrBlocks = new[]
                {
                    selected.Apply(getSubnetResult => getSubnetResult.CidrBlock),
                },
                FromPort = 80,
                ToPort = 80,
                Protocol = "tcp",
            },
        },
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ec2.Ec2Functions;
import com.pulumi.aws.ec2.inputs.GetSubnetArgs;
import com.pulumi.aws.ec2.SecurityGroup;
import com.pulumi.aws.ec2.SecurityGroupArgs;
import com.pulumi.aws.ec2.inputs.SecurityGroupIngressArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }
    public static void stack(Context ctx) {
        final var config = ctx.config();
        final var subnetId = config.get("subnetId");
        final var selected = Ec2Functions.getSubnet(GetSubnetArgs.builder()
            .id(subnetId)
            .build());
        var subnetSecurityGroup = new SecurityGroup("subnetSecurityGroup", SecurityGroupArgs.builder()
            .vpcId(selected.applyValue(getSubnetResult -> getSubnetResult.vpcId()))
            .ingress(SecurityGroupIngressArgs.builder()
                .cidrBlocks(selected.applyValue(getSubnetResult -> getSubnetResult.cidrBlock()))
                .fromPort(80)
                .toPort(80)
                .protocol("tcp")
                .build())
            .build());
    }
}
configuration:
  subnetId:
    type: dynamic
resources:
  subnetSecurityGroup:
    type: aws:ec2:SecurityGroup
    name: subnet_security_group
    properties:
      vpcId: ${selected.vpcId}
      ingress:
        - cidrBlocks:
            - ${selected.cidrBlock}
          fromPort: 80
          toPort: 80
          protocol: tcp
variables:
  selected:
    fn::invoke:
      function: aws:ec2:getSubnet
      arguments:
        id: ${subnetId}
Filter Example
If you want to match against tag Name, use:
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const selected = aws.ec2.getSubnet({
    filters: [{
        name: "tag:Name",
        values: ["yakdriver"],
    }],
});
import pulumi
import pulumi_aws as aws
selected = aws.ec2.get_subnet(filters=[{
    "name": "tag:Name",
    "values": ["yakdriver"],
}])
package main
import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := ec2.LookupSubnet(ctx, &ec2.LookupSubnetArgs{
			Filters: []ec2.GetSubnetFilter{
				{
					Name: "tag:Name",
					Values: []string{
						"yakdriver",
					},
				},
			},
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() => 
{
    var selected = Aws.Ec2.GetSubnet.Invoke(new()
    {
        Filters = new[]
        {
            new Aws.Ec2.Inputs.GetSubnetFilterInputArgs
            {
                Name = "tag:Name",
                Values = new[]
                {
                    "yakdriver",
                },
            },
        },
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ec2.Ec2Functions;
import com.pulumi.aws.ec2.inputs.GetSubnetArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }
    public static void stack(Context ctx) {
        final var selected = Ec2Functions.getSubnet(GetSubnetArgs.builder()
            .filters(GetSubnetFilterArgs.builder()
                .name("tag:Name")
                .values("yakdriver")
                .build())
            .build());
    }
}
variables:
  selected:
    fn::invoke:
      function: aws:ec2:getSubnet
      arguments:
        filters:
          - name: tag:Name
            values:
              - yakdriver
Using getSubnet
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 getSubnet(args: GetSubnetArgs, opts?: InvokeOptions): Promise<GetSubnetResult>
function getSubnetOutput(args: GetSubnetOutputArgs, opts?: InvokeOptions): Output<GetSubnetResult>def get_subnet(availability_zone: Optional[str] = None,
               availability_zone_id: Optional[str] = None,
               cidr_block: Optional[str] = None,
               default_for_az: Optional[bool] = None,
               filters: Optional[Sequence[GetSubnetFilter]] = None,
               id: Optional[str] = None,
               ipv6_cidr_block: Optional[str] = None,
               state: Optional[str] = None,
               tags: Optional[Mapping[str, str]] = None,
               vpc_id: Optional[str] = None,
               opts: Optional[InvokeOptions] = None) -> GetSubnetResult
def get_subnet_output(availability_zone: Optional[pulumi.Input[str]] = None,
               availability_zone_id: Optional[pulumi.Input[str]] = None,
               cidr_block: Optional[pulumi.Input[str]] = None,
               default_for_az: Optional[pulumi.Input[bool]] = None,
               filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetSubnetFilterArgs]]]] = None,
               id: Optional[pulumi.Input[str]] = None,
               ipv6_cidr_block: Optional[pulumi.Input[str]] = None,
               state: Optional[pulumi.Input[str]] = None,
               tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
               vpc_id: Optional[pulumi.Input[str]] = None,
               opts: Optional[InvokeOptions] = None) -> Output[GetSubnetResult]func LookupSubnet(ctx *Context, args *LookupSubnetArgs, opts ...InvokeOption) (*LookupSubnetResult, error)
func LookupSubnetOutput(ctx *Context, args *LookupSubnetOutputArgs, opts ...InvokeOption) LookupSubnetResultOutput> Note: This function is named LookupSubnet in the Go SDK.
public static class GetSubnet 
{
    public static Task<GetSubnetResult> InvokeAsync(GetSubnetArgs args, InvokeOptions? opts = null)
    public static Output<GetSubnetResult> Invoke(GetSubnetInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetSubnetResult> getSubnet(GetSubnetArgs args, InvokeOptions options)
public static Output<GetSubnetResult> getSubnet(GetSubnetArgs args, InvokeOptions options)
fn::invoke:
  function: aws:ec2/getSubnet:getSubnet
  arguments:
    # arguments dictionaryThe following arguments are supported:
- AvailabilityZone string
- Availability zone where the subnet must reside.
- AvailabilityZone stringId 
- ID of the Availability Zone for the subnet. This argument is not supported in all regions or partitions. If necessary, use availability_zoneinstead.
- CidrBlock string
- CIDR block of the desired subnet.
- DefaultFor boolAz 
- Whether the desired subnet must be the default subnet for its associated availability zone.
- Filters
List<GetSubnet Filter> 
- Configuration block. Detailed below.
- Id string
- ID of the specific subnet to retrieve.
- Ipv6CidrBlock string
- IPv6 CIDR block of the desired subnet.
- State string
- State that the desired subnet must have.
- Dictionary<string, string>
- Map of tags, each pair of which must exactly match a pair on the desired subnet.
- VpcId string
- ID of the VPC that the desired subnet belongs to.
- AvailabilityZone string
- Availability zone where the subnet must reside.
- AvailabilityZone stringId 
- ID of the Availability Zone for the subnet. This argument is not supported in all regions or partitions. If necessary, use availability_zoneinstead.
- CidrBlock string
- CIDR block of the desired subnet.
- DefaultFor boolAz 
- Whether the desired subnet must be the default subnet for its associated availability zone.
- Filters
[]GetSubnet Filter 
- Configuration block. Detailed below.
- Id string
- ID of the specific subnet to retrieve.
- Ipv6CidrBlock string
- IPv6 CIDR block of the desired subnet.
- State string
- State that the desired subnet must have.
- map[string]string
- Map of tags, each pair of which must exactly match a pair on the desired subnet.
- VpcId string
- ID of the VPC that the desired subnet belongs to.
- availabilityZone String
- Availability zone where the subnet must reside.
- availabilityZone StringId 
- ID of the Availability Zone for the subnet. This argument is not supported in all regions or partitions. If necessary, use availability_zoneinstead.
- cidrBlock String
- CIDR block of the desired subnet.
- defaultFor BooleanAz 
- Whether the desired subnet must be the default subnet for its associated availability zone.
- filters
List<GetSubnet Filter> 
- Configuration block. Detailed below.
- id String
- ID of the specific subnet to retrieve.
- ipv6CidrBlock String
- IPv6 CIDR block of the desired subnet.
- state String
- State that the desired subnet must have.
- Map<String,String>
- Map of tags, each pair of which must exactly match a pair on the desired subnet.
- vpcId String
- ID of the VPC that the desired subnet belongs to.
- availabilityZone string
- Availability zone where the subnet must reside.
- availabilityZone stringId 
- ID of the Availability Zone for the subnet. This argument is not supported in all regions or partitions. If necessary, use availability_zoneinstead.
- cidrBlock string
- CIDR block of the desired subnet.
- defaultFor booleanAz 
- Whether the desired subnet must be the default subnet for its associated availability zone.
- filters
GetSubnet Filter[] 
- Configuration block. Detailed below.
- id string
- ID of the specific subnet to retrieve.
- ipv6CidrBlock string
- IPv6 CIDR block of the desired subnet.
- state string
- State that the desired subnet must have.
- {[key: string]: string}
- Map of tags, each pair of which must exactly match a pair on the desired subnet.
- vpcId string
- ID of the VPC that the desired subnet belongs to.
- availability_zone str
- Availability zone where the subnet must reside.
- availability_zone_ strid 
- ID of the Availability Zone for the subnet. This argument is not supported in all regions or partitions. If necessary, use availability_zoneinstead.
- cidr_block str
- CIDR block of the desired subnet.
- default_for_ boolaz 
- Whether the desired subnet must be the default subnet for its associated availability zone.
- filters
Sequence[GetSubnet Filter] 
- Configuration block. Detailed below.
- id str
- ID of the specific subnet to retrieve.
- ipv6_cidr_ strblock 
- IPv6 CIDR block of the desired subnet.
- state str
- State that the desired subnet must have.
- Mapping[str, str]
- Map of tags, each pair of which must exactly match a pair on the desired subnet.
- vpc_id str
- ID of the VPC that the desired subnet belongs to.
- availabilityZone String
- Availability zone where the subnet must reside.
- availabilityZone StringId 
- ID of the Availability Zone for the subnet. This argument is not supported in all regions or partitions. If necessary, use availability_zoneinstead.
- cidrBlock String
- CIDR block of the desired subnet.
- defaultFor BooleanAz 
- Whether the desired subnet must be the default subnet for its associated availability zone.
- filters List<Property Map>
- Configuration block. Detailed below.
- id String
- ID of the specific subnet to retrieve.
- ipv6CidrBlock String
- IPv6 CIDR block of the desired subnet.
- state String
- State that the desired subnet must have.
- Map<String>
- Map of tags, each pair of which must exactly match a pair on the desired subnet.
- vpcId String
- ID of the VPC that the desired subnet belongs to.
getSubnet Result
The following output properties are available:
- Arn string
- ARN of the subnet.
- AssignIpv6Address boolOn Creation 
- Whether an IPv6 address is assigned on creation.
- AvailabilityZone string
- AvailabilityZone stringId 
- AvailableIp intAddress Count 
- Available IP addresses of the subnet.
- CidrBlock string
- CustomerOwned stringIpv4Pool 
- Identifier of customer owned IPv4 address pool.
- DefaultFor boolAz 
- EnableDns64 bool
- Whether DNS queries made to the Amazon-provided DNS Resolver in this subnet return synthetic IPv6 addresses for IPv4-only destinations.
- EnableLni intAt Device Index 
- Indicates the device position for local network interfaces in this subnet. For example, 1 indicates local network interfaces in this subnet are the secondary network interface (eth1). A local network interface cannot be the primary network interface (eth0).
- EnableResource boolName Dns ARecord On Launch 
- Indicates whether to respond to DNS queries for instance hostnames with DNS A records.
- EnableResource boolName Dns Aaaa Record On Launch 
- Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records.
- Id string
- Ipv6CidrBlock string
- Ipv6CidrBlock stringAssociation Id 
- Association ID of the IPv6 CIDR block.
- Ipv6Native bool
- Whether this is an IPv6-only subnet.
- MapCustomer boolOwned Ip On Launch 
- Whether customer owned IP addresses are assigned on network interface creation.
- MapPublic boolIp On Launch 
- Whether public IP addresses are assigned on instance launch.
- OutpostArn string
- ARN of the Outpost.
- OwnerId string
- ID of the AWS account that owns the subnet.
- PrivateDns stringHostname Type On Launch 
- The type of hostnames assigned to instances in the subnet at launch.
- State string
- Dictionary<string, string>
- VpcId string
- Filters
List<GetSubnet Filter> 
- Arn string
- ARN of the subnet.
- AssignIpv6Address boolOn Creation 
- Whether an IPv6 address is assigned on creation.
- AvailabilityZone string
- AvailabilityZone stringId 
- AvailableIp intAddress Count 
- Available IP addresses of the subnet.
- CidrBlock string
- CustomerOwned stringIpv4Pool 
- Identifier of customer owned IPv4 address pool.
- DefaultFor boolAz 
- EnableDns64 bool
- Whether DNS queries made to the Amazon-provided DNS Resolver in this subnet return synthetic IPv6 addresses for IPv4-only destinations.
- EnableLni intAt Device Index 
- Indicates the device position for local network interfaces in this subnet. For example, 1 indicates local network interfaces in this subnet are the secondary network interface (eth1). A local network interface cannot be the primary network interface (eth0).
- EnableResource boolName Dns ARecord On Launch 
- Indicates whether to respond to DNS queries for instance hostnames with DNS A records.
- EnableResource boolName Dns Aaaa Record On Launch 
- Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records.
- Id string
- Ipv6CidrBlock string
- Ipv6CidrBlock stringAssociation Id 
- Association ID of the IPv6 CIDR block.
- Ipv6Native bool
- Whether this is an IPv6-only subnet.
- MapCustomer boolOwned Ip On Launch 
- Whether customer owned IP addresses are assigned on network interface creation.
- MapPublic boolIp On Launch 
- Whether public IP addresses are assigned on instance launch.
- OutpostArn string
- ARN of the Outpost.
- OwnerId string
- ID of the AWS account that owns the subnet.
- PrivateDns stringHostname Type On Launch 
- The type of hostnames assigned to instances in the subnet at launch.
- State string
- map[string]string
- VpcId string
- Filters
[]GetSubnet Filter 
- arn String
- ARN of the subnet.
- assignIpv6Address BooleanOn Creation 
- Whether an IPv6 address is assigned on creation.
- availabilityZone String
- availabilityZone StringId 
- availableIp IntegerAddress Count 
- Available IP addresses of the subnet.
- cidrBlock String
- customerOwned StringIpv4Pool 
- Identifier of customer owned IPv4 address pool.
- defaultFor BooleanAz 
- enableDns64 Boolean
- Whether DNS queries made to the Amazon-provided DNS Resolver in this subnet return synthetic IPv6 addresses for IPv4-only destinations.
- enableLni IntegerAt Device Index 
- Indicates the device position for local network interfaces in this subnet. For example, 1 indicates local network interfaces in this subnet are the secondary network interface (eth1). A local network interface cannot be the primary network interface (eth0).
- enableResource BooleanName Dns ARecord On Launch 
- Indicates whether to respond to DNS queries for instance hostnames with DNS A records.
- enableResource BooleanName Dns Aaaa Record On Launch 
- Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records.
- id String
- ipv6CidrBlock String
- ipv6CidrBlock StringAssociation Id 
- Association ID of the IPv6 CIDR block.
- ipv6Native Boolean
- Whether this is an IPv6-only subnet.
- mapCustomer BooleanOwned Ip On Launch 
- Whether customer owned IP addresses are assigned on network interface creation.
- mapPublic BooleanIp On Launch 
- Whether public IP addresses are assigned on instance launch.
- outpostArn String
- ARN of the Outpost.
- ownerId String
- ID of the AWS account that owns the subnet.
- privateDns StringHostname Type On Launch 
- The type of hostnames assigned to instances in the subnet at launch.
- state String
- Map<String,String>
- vpcId String
- filters
List<GetSubnet Filter> 
- arn string
- ARN of the subnet.
- assignIpv6Address booleanOn Creation 
- Whether an IPv6 address is assigned on creation.
- availabilityZone string
- availabilityZone stringId 
- availableIp numberAddress Count 
- Available IP addresses of the subnet.
- cidrBlock string
- customerOwned stringIpv4Pool 
- Identifier of customer owned IPv4 address pool.
- defaultFor booleanAz 
- enableDns64 boolean
- Whether DNS queries made to the Amazon-provided DNS Resolver in this subnet return synthetic IPv6 addresses for IPv4-only destinations.
- enableLni numberAt Device Index 
- Indicates the device position for local network interfaces in this subnet. For example, 1 indicates local network interfaces in this subnet are the secondary network interface (eth1). A local network interface cannot be the primary network interface (eth0).
- enableResource booleanName Dns ARecord On Launch 
- Indicates whether to respond to DNS queries for instance hostnames with DNS A records.
- enableResource booleanName Dns Aaaa Record On Launch 
- Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records.
- id string
- ipv6CidrBlock string
- ipv6CidrBlock stringAssociation Id 
- Association ID of the IPv6 CIDR block.
- ipv6Native boolean
- Whether this is an IPv6-only subnet.
- mapCustomer booleanOwned Ip On Launch 
- Whether customer owned IP addresses are assigned on network interface creation.
- mapPublic booleanIp On Launch 
- Whether public IP addresses are assigned on instance launch.
- outpostArn string
- ARN of the Outpost.
- ownerId string
- ID of the AWS account that owns the subnet.
- privateDns stringHostname Type On Launch 
- The type of hostnames assigned to instances in the subnet at launch.
- state string
- {[key: string]: string}
- vpcId string
- filters
GetSubnet Filter[] 
- arn str
- ARN of the subnet.
- assign_ipv6_ booladdress_ on_ creation 
- Whether an IPv6 address is assigned on creation.
- availability_zone str
- availability_zone_ strid 
- available_ip_ intaddress_ count 
- Available IP addresses of the subnet.
- cidr_block str
- customer_owned_ stripv4_ pool 
- Identifier of customer owned IPv4 address pool.
- default_for_ boolaz 
- enable_dns64 bool
- Whether DNS queries made to the Amazon-provided DNS Resolver in this subnet return synthetic IPv6 addresses for IPv4-only destinations.
- enable_lni_ intat_ device_ index 
- Indicates the device position for local network interfaces in this subnet. For example, 1 indicates local network interfaces in this subnet are the secondary network interface (eth1). A local network interface cannot be the primary network interface (eth0).
- enable_resource_ boolname_ dns_ a_ record_ on_ launch 
- Indicates whether to respond to DNS queries for instance hostnames with DNS A records.
- enable_resource_ boolname_ dns_ aaaa_ record_ on_ launch 
- Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records.
- id str
- ipv6_cidr_ strblock 
- ipv6_cidr_ strblock_ association_ id 
- Association ID of the IPv6 CIDR block.
- ipv6_native bool
- Whether this is an IPv6-only subnet.
- map_customer_ boolowned_ ip_ on_ launch 
- Whether customer owned IP addresses are assigned on network interface creation.
- map_public_ boolip_ on_ launch 
- Whether public IP addresses are assigned on instance launch.
- outpost_arn str
- ARN of the Outpost.
- owner_id str
- ID of the AWS account that owns the subnet.
- private_dns_ strhostname_ type_ on_ launch 
- The type of hostnames assigned to instances in the subnet at launch.
- state str
- Mapping[str, str]
- vpc_id str
- filters
Sequence[GetSubnet Filter] 
- arn String
- ARN of the subnet.
- assignIpv6Address BooleanOn Creation 
- Whether an IPv6 address is assigned on creation.
- availabilityZone String
- availabilityZone StringId 
- availableIp NumberAddress Count 
- Available IP addresses of the subnet.
- cidrBlock String
- customerOwned StringIpv4Pool 
- Identifier of customer owned IPv4 address pool.
- defaultFor BooleanAz 
- enableDns64 Boolean
- Whether DNS queries made to the Amazon-provided DNS Resolver in this subnet return synthetic IPv6 addresses for IPv4-only destinations.
- enableLni NumberAt Device Index 
- Indicates the device position for local network interfaces in this subnet. For example, 1 indicates local network interfaces in this subnet are the secondary network interface (eth1). A local network interface cannot be the primary network interface (eth0).
- enableResource BooleanName Dns ARecord On Launch 
- Indicates whether to respond to DNS queries for instance hostnames with DNS A records.
- enableResource BooleanName Dns Aaaa Record On Launch 
- Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records.
- id String
- ipv6CidrBlock String
- ipv6CidrBlock StringAssociation Id 
- Association ID of the IPv6 CIDR block.
- ipv6Native Boolean
- Whether this is an IPv6-only subnet.
- mapCustomer BooleanOwned Ip On Launch 
- Whether customer owned IP addresses are assigned on network interface creation.
- mapPublic BooleanIp On Launch 
- Whether public IP addresses are assigned on instance launch.
- outpostArn String
- ARN of the Outpost.
- ownerId String
- ID of the AWS account that owns the subnet.
- privateDns StringHostname Type On Launch 
- The type of hostnames assigned to instances in the subnet at launch.
- state String
- Map<String>
- vpcId String
- filters List<Property Map>
Supporting Types
GetSubnetFilter  
- 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 subnet 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 subnet 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 subnet 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 subnet 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 subnet 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 subnet 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.