1. Packages
  2. AWS
  3. API Docs
  4. ec2
  5. getSubnet
AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi

aws.ec2.getSubnet

Explore with Pulumi AI

aws logo
AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi

    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)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: aws:ec2/getSubnet:getSubnet
      arguments:
        # arguments dictionary

    The following arguments are supported:

    AvailabilityZone string
    Availability zone where the subnet must reside.
    AvailabilityZoneId string
    ID of the Availability Zone for the subnet. This argument is not supported in all regions or partitions. If necessary, use availability_zone instead.
    CidrBlock string
    CIDR block of the desired subnet.
    DefaultForAz bool
    Whether the desired subnet must be the default subnet for its associated availability zone.
    Filters List<GetSubnetFilter>
    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.
    Tags 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.
    AvailabilityZoneId string
    ID of the Availability Zone for the subnet. This argument is not supported in all regions or partitions. If necessary, use availability_zone instead.
    CidrBlock string
    CIDR block of the desired subnet.
    DefaultForAz bool
    Whether the desired subnet must be the default subnet for its associated availability zone.
    Filters []GetSubnetFilter
    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.
    Tags 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.
    availabilityZoneId String
    ID of the Availability Zone for the subnet. This argument is not supported in all regions or partitions. If necessary, use availability_zone instead.
    cidrBlock String
    CIDR block of the desired subnet.
    defaultForAz Boolean
    Whether the desired subnet must be the default subnet for its associated availability zone.
    filters List<GetSubnetFilter>
    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.
    tags 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.
    availabilityZoneId string
    ID of the Availability Zone for the subnet. This argument is not supported in all regions or partitions. If necessary, use availability_zone instead.
    cidrBlock string
    CIDR block of the desired subnet.
    defaultForAz boolean
    Whether the desired subnet must be the default subnet for its associated availability zone.
    filters GetSubnetFilter[]
    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.
    tags {[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_id str
    ID of the Availability Zone for the subnet. This argument is not supported in all regions or partitions. If necessary, use availability_zone instead.
    cidr_block str
    CIDR block of the desired subnet.
    default_for_az bool
    Whether the desired subnet must be the default subnet for its associated availability zone.
    filters Sequence[GetSubnetFilter]
    Configuration block. Detailed below.
    id str
    ID of the specific subnet to retrieve.
    ipv6_cidr_block str
    IPv6 CIDR block of the desired subnet.
    state str
    State that the desired subnet must have.
    tags 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.
    availabilityZoneId String
    ID of the Availability Zone for the subnet. This argument is not supported in all regions or partitions. If necessary, use availability_zone instead.
    cidrBlock String
    CIDR block of the desired subnet.
    defaultForAz Boolean
    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.
    tags 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.
    AssignIpv6AddressOnCreation bool
    Whether an IPv6 address is assigned on creation.
    AvailabilityZone string
    AvailabilityZoneId string
    AvailableIpAddressCount int
    Available IP addresses of the subnet.
    CidrBlock string
    CustomerOwnedIpv4Pool string
    Identifier of customer owned IPv4 address pool.
    DefaultForAz bool
    EnableDns64 bool
    Whether DNS queries made to the Amazon-provided DNS Resolver in this subnet return synthetic IPv6 addresses for IPv4-only destinations.
    EnableLniAtDeviceIndex int
    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).
    EnableResourceNameDnsARecordOnLaunch bool
    Indicates whether to respond to DNS queries for instance hostnames with DNS A records.
    EnableResourceNameDnsAaaaRecordOnLaunch bool
    Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records.
    Id string
    Ipv6CidrBlock string
    Ipv6CidrBlockAssociationId string
    Association ID of the IPv6 CIDR block.
    Ipv6Native bool
    Whether this is an IPv6-only subnet.
    MapCustomerOwnedIpOnLaunch bool
    Whether customer owned IP addresses are assigned on network interface creation.
    MapPublicIpOnLaunch bool
    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.
    PrivateDnsHostnameTypeOnLaunch string
    The type of hostnames assigned to instances in the subnet at launch.
    State string
    Tags Dictionary<string, string>
    VpcId string
    Filters List<GetSubnetFilter>
    Arn string
    ARN of the subnet.
    AssignIpv6AddressOnCreation bool
    Whether an IPv6 address is assigned on creation.
    AvailabilityZone string
    AvailabilityZoneId string
    AvailableIpAddressCount int
    Available IP addresses of the subnet.
    CidrBlock string
    CustomerOwnedIpv4Pool string
    Identifier of customer owned IPv4 address pool.
    DefaultForAz bool
    EnableDns64 bool
    Whether DNS queries made to the Amazon-provided DNS Resolver in this subnet return synthetic IPv6 addresses for IPv4-only destinations.
    EnableLniAtDeviceIndex int
    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).
    EnableResourceNameDnsARecordOnLaunch bool
    Indicates whether to respond to DNS queries for instance hostnames with DNS A records.
    EnableResourceNameDnsAaaaRecordOnLaunch bool
    Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records.
    Id string
    Ipv6CidrBlock string
    Ipv6CidrBlockAssociationId string
    Association ID of the IPv6 CIDR block.
    Ipv6Native bool
    Whether this is an IPv6-only subnet.
    MapCustomerOwnedIpOnLaunch bool
    Whether customer owned IP addresses are assigned on network interface creation.
    MapPublicIpOnLaunch bool
    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.
    PrivateDnsHostnameTypeOnLaunch string
    The type of hostnames assigned to instances in the subnet at launch.
    State string
    Tags map[string]string
    VpcId string
    Filters []GetSubnetFilter
    arn String
    ARN of the subnet.
    assignIpv6AddressOnCreation Boolean
    Whether an IPv6 address is assigned on creation.
    availabilityZone String
    availabilityZoneId String
    availableIpAddressCount Integer
    Available IP addresses of the subnet.
    cidrBlock String
    customerOwnedIpv4Pool String
    Identifier of customer owned IPv4 address pool.
    defaultForAz Boolean
    enableDns64 Boolean
    Whether DNS queries made to the Amazon-provided DNS Resolver in this subnet return synthetic IPv6 addresses for IPv4-only destinations.
    enableLniAtDeviceIndex Integer
    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).
    enableResourceNameDnsARecordOnLaunch Boolean
    Indicates whether to respond to DNS queries for instance hostnames with DNS A records.
    enableResourceNameDnsAaaaRecordOnLaunch Boolean
    Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records.
    id String
    ipv6CidrBlock String
    ipv6CidrBlockAssociationId String
    Association ID of the IPv6 CIDR block.
    ipv6Native Boolean
    Whether this is an IPv6-only subnet.
    mapCustomerOwnedIpOnLaunch Boolean
    Whether customer owned IP addresses are assigned on network interface creation.
    mapPublicIpOnLaunch Boolean
    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.
    privateDnsHostnameTypeOnLaunch String
    The type of hostnames assigned to instances in the subnet at launch.
    state String
    tags Map<String,String>
    vpcId String
    filters List<GetSubnetFilter>
    arn string
    ARN of the subnet.
    assignIpv6AddressOnCreation boolean
    Whether an IPv6 address is assigned on creation.
    availabilityZone string
    availabilityZoneId string
    availableIpAddressCount number
    Available IP addresses of the subnet.
    cidrBlock string
    customerOwnedIpv4Pool string
    Identifier of customer owned IPv4 address pool.
    defaultForAz boolean
    enableDns64 boolean
    Whether DNS queries made to the Amazon-provided DNS Resolver in this subnet return synthetic IPv6 addresses for IPv4-only destinations.
    enableLniAtDeviceIndex number
    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).
    enableResourceNameDnsARecordOnLaunch boolean
    Indicates whether to respond to DNS queries for instance hostnames with DNS A records.
    enableResourceNameDnsAaaaRecordOnLaunch boolean
    Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records.
    id string
    ipv6CidrBlock string
    ipv6CidrBlockAssociationId string
    Association ID of the IPv6 CIDR block.
    ipv6Native boolean
    Whether this is an IPv6-only subnet.
    mapCustomerOwnedIpOnLaunch boolean
    Whether customer owned IP addresses are assigned on network interface creation.
    mapPublicIpOnLaunch boolean
    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.
    privateDnsHostnameTypeOnLaunch string
    The type of hostnames assigned to instances in the subnet at launch.
    state string
    tags {[key: string]: string}
    vpcId string
    filters GetSubnetFilter[]
    arn str
    ARN of the subnet.
    assign_ipv6_address_on_creation bool
    Whether an IPv6 address is assigned on creation.
    availability_zone str
    availability_zone_id str
    available_ip_address_count int
    Available IP addresses of the subnet.
    cidr_block str
    customer_owned_ipv4_pool str
    Identifier of customer owned IPv4 address pool.
    default_for_az bool
    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_at_device_index int
    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_name_dns_a_record_on_launch bool
    Indicates whether to respond to DNS queries for instance hostnames with DNS A records.
    enable_resource_name_dns_aaaa_record_on_launch bool
    Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records.
    id str
    ipv6_cidr_block str
    ipv6_cidr_block_association_id str
    Association ID of the IPv6 CIDR block.
    ipv6_native bool
    Whether this is an IPv6-only subnet.
    map_customer_owned_ip_on_launch bool
    Whether customer owned IP addresses are assigned on network interface creation.
    map_public_ip_on_launch bool
    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_hostname_type_on_launch str
    The type of hostnames assigned to instances in the subnet at launch.
    state str
    tags Mapping[str, str]
    vpc_id str
    filters Sequence[GetSubnetFilter]
    arn String
    ARN of the subnet.
    assignIpv6AddressOnCreation Boolean
    Whether an IPv6 address is assigned on creation.
    availabilityZone String
    availabilityZoneId String
    availableIpAddressCount Number
    Available IP addresses of the subnet.
    cidrBlock String
    customerOwnedIpv4Pool String
    Identifier of customer owned IPv4 address pool.
    defaultForAz Boolean
    enableDns64 Boolean
    Whether DNS queries made to the Amazon-provided DNS Resolver in this subnet return synthetic IPv6 addresses for IPv4-only destinations.
    enableLniAtDeviceIndex Number
    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).
    enableResourceNameDnsARecordOnLaunch Boolean
    Indicates whether to respond to DNS queries for instance hostnames with DNS A records.
    enableResourceNameDnsAaaaRecordOnLaunch Boolean
    Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records.
    id String
    ipv6CidrBlock String
    ipv6CidrBlockAssociationId String
    Association ID of the IPv6 CIDR block.
    ipv6Native Boolean
    Whether this is an IPv6-only subnet.
    mapCustomerOwnedIpOnLaunch Boolean
    Whether customer owned IP addresses are assigned on network interface creation.
    mapPublicIpOnLaunch Boolean
    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.
    privateDnsHostnameTypeOnLaunch String
    The type of hostnames assigned to instances in the subnet at launch.
    state String
    tags 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 aws Terraform Provider.
    aws logo
    AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi