aws.ec2.Subnet
Provides an VPC subnet resource.
NOTE: Due to AWS Lambda improved VPC networking changes that began deploying in September 2019, subnets associated with Lambda Functions can take up to 45 minutes to successfully delete. To allow for successful deletion, the provider will wait for at least 45 minutes even if a shorter delete timeout is specified.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const main = new aws.ec2.Subnet("main", {
    vpcId: mainAwsVpc.id,
    cidrBlock: "10.0.1.0/24",
    tags: {
        Name: "Main",
    },
});
import pulumi
import pulumi_aws as aws
main = aws.ec2.Subnet("main",
    vpc_id=main_aws_vpc["id"],
    cidr_block="10.0.1.0/24",
    tags={
        "Name": "Main",
    })
package main
import (
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/ec2"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := ec2.NewSubnet(ctx, "main", &ec2.SubnetArgs{
			VpcId:     pulumi.Any(mainAwsVpc.Id),
			CidrBlock: pulumi.String("10.0.1.0/24"),
			Tags: pulumi.StringMap{
				"Name": pulumi.String("Main"),
			},
		})
		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 main = new Aws.Ec2.Subnet("main", new()
    {
        VpcId = mainAwsVpc.Id,
        CidrBlock = "10.0.1.0/24",
        Tags = 
        {
            { "Name", "Main" },
        },
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ec2.Subnet;
import com.pulumi.aws.ec2.SubnetArgs;
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) {
        var main = new Subnet("main", SubnetArgs.builder()
            .vpcId(mainAwsVpc.id())
            .cidrBlock("10.0.1.0/24")
            .tags(Map.of("Name", "Main"))
            .build());
    }
}
resources:
  main:
    type: aws:ec2:Subnet
    properties:
      vpcId: ${mainAwsVpc.id}
      cidrBlock: 10.0.1.0/24
      tags:
        Name: Main
Subnets In Secondary VPC CIDR Blocks
When managing subnets in one of a VPC’s secondary CIDR blocks created using a aws.ec2.VpcIpv4CidrBlockAssociation
resource, it is recommended to reference that resource’s vpc_id attribute to ensure correct dependency ordering.
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const secondaryCidr = new aws.ec2.VpcIpv4CidrBlockAssociation("secondary_cidr", {
    vpcId: main.id,
    cidrBlock: "172.20.0.0/16",
});
const inSecondaryCidr = new aws.ec2.Subnet("in_secondary_cidr", {
    vpcId: secondaryCidr.vpcId,
    cidrBlock: "172.20.0.0/24",
});
import pulumi
import pulumi_aws as aws
secondary_cidr = aws.ec2.VpcIpv4CidrBlockAssociation("secondary_cidr",
    vpc_id=main["id"],
    cidr_block="172.20.0.0/16")
in_secondary_cidr = aws.ec2.Subnet("in_secondary_cidr",
    vpc_id=secondary_cidr.vpc_id,
    cidr_block="172.20.0.0/24")
package main
import (
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/ec2"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		secondaryCidr, err := ec2.NewVpcIpv4CidrBlockAssociation(ctx, "secondary_cidr", &ec2.VpcIpv4CidrBlockAssociationArgs{
			VpcId:     pulumi.Any(main.Id),
			CidrBlock: pulumi.String("172.20.0.0/16"),
		})
		if err != nil {
			return err
		}
		_, err = ec2.NewSubnet(ctx, "in_secondary_cidr", &ec2.SubnetArgs{
			VpcId:     secondaryCidr.VpcId,
			CidrBlock: pulumi.String("172.20.0.0/24"),
		})
		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 secondaryCidr = new Aws.Ec2.VpcIpv4CidrBlockAssociation("secondary_cidr", new()
    {
        VpcId = main.Id,
        CidrBlock = "172.20.0.0/16",
    });
    var inSecondaryCidr = new Aws.Ec2.Subnet("in_secondary_cidr", new()
    {
        VpcId = secondaryCidr.VpcId,
        CidrBlock = "172.20.0.0/24",
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ec2.VpcIpv4CidrBlockAssociation;
import com.pulumi.aws.ec2.VpcIpv4CidrBlockAssociationArgs;
import com.pulumi.aws.ec2.Subnet;
import com.pulumi.aws.ec2.SubnetArgs;
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) {
        var secondaryCidr = new VpcIpv4CidrBlockAssociation("secondaryCidr", VpcIpv4CidrBlockAssociationArgs.builder()
            .vpcId(main.id())
            .cidrBlock("172.20.0.0/16")
            .build());
        var inSecondaryCidr = new Subnet("inSecondaryCidr", SubnetArgs.builder()
            .vpcId(secondaryCidr.vpcId())
            .cidrBlock("172.20.0.0/24")
            .build());
    }
}
resources:
  secondaryCidr:
    type: aws:ec2:VpcIpv4CidrBlockAssociation
    name: secondary_cidr
    properties:
      vpcId: ${main.id}
      cidrBlock: 172.20.0.0/16
  inSecondaryCidr:
    type: aws:ec2:Subnet
    name: in_secondary_cidr
    properties:
      vpcId: ${secondaryCidr.vpcId}
      cidrBlock: 172.20.0.0/24
Create Subnet Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Subnet(name: string, args: SubnetArgs, opts?: CustomResourceOptions);@overload
def Subnet(resource_name: str,
           args: SubnetArgs,
           opts: Optional[ResourceOptions] = None)
@overload
def Subnet(resource_name: str,
           opts: Optional[ResourceOptions] = None,
           vpc_id: Optional[str] = None,
           enable_resource_name_dns_aaaa_record_on_launch: Optional[bool] = None,
           ipv6_native: Optional[bool] = None,
           cidr_block: Optional[str] = None,
           customer_owned_ipv4_pool: Optional[str] = None,
           enable_dns64: Optional[bool] = None,
           enable_lni_at_device_index: Optional[int] = None,
           enable_resource_name_dns_a_record_on_launch: Optional[bool] = None,
           assign_ipv6_address_on_creation: Optional[bool] = None,
           availability_zone_id: Optional[str] = None,
           map_customer_owned_ip_on_launch: Optional[bool] = None,
           ipv6_cidr_block: Optional[str] = None,
           map_public_ip_on_launch: Optional[bool] = None,
           outpost_arn: Optional[str] = None,
           private_dns_hostname_type_on_launch: Optional[str] = None,
           region: Optional[str] = None,
           tags: Optional[Mapping[str, str]] = None,
           availability_zone: Optional[str] = None)func NewSubnet(ctx *Context, name string, args SubnetArgs, opts ...ResourceOption) (*Subnet, error)public Subnet(string name, SubnetArgs args, CustomResourceOptions? opts = null)
public Subnet(String name, SubnetArgs args)
public Subnet(String name, SubnetArgs args, CustomResourceOptions options)
type: aws:ec2:Subnet
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args SubnetArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args SubnetArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args SubnetArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args SubnetArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args SubnetArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var subnetResource = new Aws.Ec2.Subnet("subnetResource", new()
{
    VpcId = "string",
    EnableResourceNameDnsAaaaRecordOnLaunch = false,
    Ipv6Native = false,
    CidrBlock = "string",
    CustomerOwnedIpv4Pool = "string",
    EnableDns64 = false,
    EnableLniAtDeviceIndex = 0,
    EnableResourceNameDnsARecordOnLaunch = false,
    AssignIpv6AddressOnCreation = false,
    AvailabilityZoneId = "string",
    MapCustomerOwnedIpOnLaunch = false,
    Ipv6CidrBlock = "string",
    MapPublicIpOnLaunch = false,
    OutpostArn = "string",
    PrivateDnsHostnameTypeOnLaunch = "string",
    Region = "string",
    Tags = 
    {
        { "string", "string" },
    },
    AvailabilityZone = "string",
});
example, err := ec2.NewSubnet(ctx, "subnetResource", &ec2.SubnetArgs{
	VpcId:                                   pulumi.String("string"),
	EnableResourceNameDnsAaaaRecordOnLaunch: pulumi.Bool(false),
	Ipv6Native:                              pulumi.Bool(false),
	CidrBlock:                               pulumi.String("string"),
	CustomerOwnedIpv4Pool:                   pulumi.String("string"),
	EnableDns64:                             pulumi.Bool(false),
	EnableLniAtDeviceIndex:                  pulumi.Int(0),
	EnableResourceNameDnsARecordOnLaunch:    pulumi.Bool(false),
	AssignIpv6AddressOnCreation:             pulumi.Bool(false),
	AvailabilityZoneId:                      pulumi.String("string"),
	MapCustomerOwnedIpOnLaunch:              pulumi.Bool(false),
	Ipv6CidrBlock:                           pulumi.String("string"),
	MapPublicIpOnLaunch:                     pulumi.Bool(false),
	OutpostArn:                              pulumi.String("string"),
	PrivateDnsHostnameTypeOnLaunch:          pulumi.String("string"),
	Region:                                  pulumi.String("string"),
	Tags: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
	AvailabilityZone: pulumi.String("string"),
})
var subnetResource = new Subnet("subnetResource", SubnetArgs.builder()
    .vpcId("string")
    .enableResourceNameDnsAaaaRecordOnLaunch(false)
    .ipv6Native(false)
    .cidrBlock("string")
    .customerOwnedIpv4Pool("string")
    .enableDns64(false)
    .enableLniAtDeviceIndex(0)
    .enableResourceNameDnsARecordOnLaunch(false)
    .assignIpv6AddressOnCreation(false)
    .availabilityZoneId("string")
    .mapCustomerOwnedIpOnLaunch(false)
    .ipv6CidrBlock("string")
    .mapPublicIpOnLaunch(false)
    .outpostArn("string")
    .privateDnsHostnameTypeOnLaunch("string")
    .region("string")
    .tags(Map.of("string", "string"))
    .availabilityZone("string")
    .build());
subnet_resource = aws.ec2.Subnet("subnetResource",
    vpc_id="string",
    enable_resource_name_dns_aaaa_record_on_launch=False,
    ipv6_native=False,
    cidr_block="string",
    customer_owned_ipv4_pool="string",
    enable_dns64=False,
    enable_lni_at_device_index=0,
    enable_resource_name_dns_a_record_on_launch=False,
    assign_ipv6_address_on_creation=False,
    availability_zone_id="string",
    map_customer_owned_ip_on_launch=False,
    ipv6_cidr_block="string",
    map_public_ip_on_launch=False,
    outpost_arn="string",
    private_dns_hostname_type_on_launch="string",
    region="string",
    tags={
        "string": "string",
    },
    availability_zone="string")
const subnetResource = new aws.ec2.Subnet("subnetResource", {
    vpcId: "string",
    enableResourceNameDnsAaaaRecordOnLaunch: false,
    ipv6Native: false,
    cidrBlock: "string",
    customerOwnedIpv4Pool: "string",
    enableDns64: false,
    enableLniAtDeviceIndex: 0,
    enableResourceNameDnsARecordOnLaunch: false,
    assignIpv6AddressOnCreation: false,
    availabilityZoneId: "string",
    mapCustomerOwnedIpOnLaunch: false,
    ipv6CidrBlock: "string",
    mapPublicIpOnLaunch: false,
    outpostArn: "string",
    privateDnsHostnameTypeOnLaunch: "string",
    region: "string",
    tags: {
        string: "string",
    },
    availabilityZone: "string",
});
type: aws:ec2:Subnet
properties:
    assignIpv6AddressOnCreation: false
    availabilityZone: string
    availabilityZoneId: string
    cidrBlock: string
    customerOwnedIpv4Pool: string
    enableDns64: false
    enableLniAtDeviceIndex: 0
    enableResourceNameDnsARecordOnLaunch: false
    enableResourceNameDnsAaaaRecordOnLaunch: false
    ipv6CidrBlock: string
    ipv6Native: false
    mapCustomerOwnedIpOnLaunch: false
    mapPublicIpOnLaunch: false
    outpostArn: string
    privateDnsHostnameTypeOnLaunch: string
    region: string
    tags:
        string: string
    vpcId: string
Subnet Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The Subnet resource accepts the following input properties:
- VpcId string
- The VPC ID.
- AssignIpv6Address boolOn Creation 
- Specify true to indicate
that network interfaces created in the specified subnet should be
assigned an IPv6 address. Default is false
- AvailabilityZone string
- AZ for the subnet.
- AvailabilityZone stringId 
- AZ ID of the subnet. This argument is not supported in all regions or partitions. If necessary, use availability_zoneinstead.
- CidrBlock string
- The IPv4 CIDR block for the subnet.
- CustomerOwned stringIpv4Pool 
- The customer owned IPv4 address pool. Typically used with the map_customer_owned_ip_on_launchargument. Theoutpost_arnargument must be specified when configured.
- EnableDns64 bool
- Indicates whether DNS queries made to the Amazon-provided DNS Resolver in this subnet should return synthetic IPv6 addresses for IPv4-only destinations. Default: false.
- 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. Default: false.
- EnableResource boolName Dns Aaaa Record On Launch 
- Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records. Default: false.
- Ipv6CidrBlock string
- The IPv6 network range for the subnet, in CIDR notation. The subnet size must use a /64 prefix length.
- Ipv6Native bool
- Indicates whether to create an IPv6-only subnet. Default: false.
- MapCustomer boolOwned Ip On Launch 
- Specify trueto indicate that network interfaces created in the subnet should be assigned a customer owned IP address. Thecustomer_owned_ipv4_poolandoutpost_arnarguments must be specified when set totrue. Default isfalse.
- MapPublic boolIp On Launch 
- Specify true to indicate
that instances launched into the subnet should be assigned
a public IP address. Default is false.
- OutpostArn string
- The Amazon Resource Name (ARN) of the Outpost.
- PrivateDns stringHostname Type On Launch 
- The type of hostnames to assign to instances in the subnet at launch. For IPv6-only subnets, an instance DNS name must be based on the instance ID. For dual-stack and IPv4-only subnets, you can specify whether DNS names use the instance IPv4 address or the instance ID. Valid values: ip-name,resource-name.
- Region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- Dictionary<string, string>
- A map of tags to assign to the resource. .If configured with a provider default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- VpcId string
- The VPC ID.
- AssignIpv6Address boolOn Creation 
- Specify true to indicate
that network interfaces created in the specified subnet should be
assigned an IPv6 address. Default is false
- AvailabilityZone string
- AZ for the subnet.
- AvailabilityZone stringId 
- AZ ID of the subnet. This argument is not supported in all regions or partitions. If necessary, use availability_zoneinstead.
- CidrBlock string
- The IPv4 CIDR block for the subnet.
- CustomerOwned stringIpv4Pool 
- The customer owned IPv4 address pool. Typically used with the map_customer_owned_ip_on_launchargument. Theoutpost_arnargument must be specified when configured.
- EnableDns64 bool
- Indicates whether DNS queries made to the Amazon-provided DNS Resolver in this subnet should return synthetic IPv6 addresses for IPv4-only destinations. Default: false.
- 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. Default: false.
- EnableResource boolName Dns Aaaa Record On Launch 
- Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records. Default: false.
- Ipv6CidrBlock string
- The IPv6 network range for the subnet, in CIDR notation. The subnet size must use a /64 prefix length.
- Ipv6Native bool
- Indicates whether to create an IPv6-only subnet. Default: false.
- MapCustomer boolOwned Ip On Launch 
- Specify trueto indicate that network interfaces created in the subnet should be assigned a customer owned IP address. Thecustomer_owned_ipv4_poolandoutpost_arnarguments must be specified when set totrue. Default isfalse.
- MapPublic boolIp On Launch 
- Specify true to indicate
that instances launched into the subnet should be assigned
a public IP address. Default is false.
- OutpostArn string
- The Amazon Resource Name (ARN) of the Outpost.
- PrivateDns stringHostname Type On Launch 
- The type of hostnames to assign to instances in the subnet at launch. For IPv6-only subnets, an instance DNS name must be based on the instance ID. For dual-stack and IPv4-only subnets, you can specify whether DNS names use the instance IPv4 address or the instance ID. Valid values: ip-name,resource-name.
- Region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- map[string]string
- A map of tags to assign to the resource. .If configured with a provider default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- vpcId String
- The VPC ID.
- assignIpv6Address BooleanOn Creation 
- Specify true to indicate
that network interfaces created in the specified subnet should be
assigned an IPv6 address. Default is false
- availabilityZone String
- AZ for the subnet.
- availabilityZone StringId 
- AZ ID of the subnet. This argument is not supported in all regions or partitions. If necessary, use availability_zoneinstead.
- cidrBlock String
- The IPv4 CIDR block for the subnet.
- customerOwned StringIpv4Pool 
- The customer owned IPv4 address pool. Typically used with the map_customer_owned_ip_on_launchargument. Theoutpost_arnargument must be specified when configured.
- enableDns64 Boolean
- Indicates whether DNS queries made to the Amazon-provided DNS Resolver in this subnet should return synthetic IPv6 addresses for IPv4-only destinations. Default: false.
- 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. Default: false.
- enableResource BooleanName Dns Aaaa Record On Launch 
- Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records. Default: false.
- ipv6CidrBlock String
- The IPv6 network range for the subnet, in CIDR notation. The subnet size must use a /64 prefix length.
- ipv6Native Boolean
- Indicates whether to create an IPv6-only subnet. Default: false.
- mapCustomer BooleanOwned Ip On Launch 
- Specify trueto indicate that network interfaces created in the subnet should be assigned a customer owned IP address. Thecustomer_owned_ipv4_poolandoutpost_arnarguments must be specified when set totrue. Default isfalse.
- mapPublic BooleanIp On Launch 
- Specify true to indicate
that instances launched into the subnet should be assigned
a public IP address. Default is false.
- outpostArn String
- The Amazon Resource Name (ARN) of the Outpost.
- privateDns StringHostname Type On Launch 
- The type of hostnames to assign to instances in the subnet at launch. For IPv6-only subnets, an instance DNS name must be based on the instance ID. For dual-stack and IPv4-only subnets, you can specify whether DNS names use the instance IPv4 address or the instance ID. Valid values: ip-name,resource-name.
- region String
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- Map<String,String>
- A map of tags to assign to the resource. .If configured with a provider default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- vpcId string
- The VPC ID.
- assignIpv6Address booleanOn Creation 
- Specify true to indicate
that network interfaces created in the specified subnet should be
assigned an IPv6 address. Default is false
- availabilityZone string
- AZ for the subnet.
- availabilityZone stringId 
- AZ ID of the subnet. This argument is not supported in all regions or partitions. If necessary, use availability_zoneinstead.
- cidrBlock string
- The IPv4 CIDR block for the subnet.
- customerOwned stringIpv4Pool 
- The customer owned IPv4 address pool. Typically used with the map_customer_owned_ip_on_launchargument. Theoutpost_arnargument must be specified when configured.
- enableDns64 boolean
- Indicates whether DNS queries made to the Amazon-provided DNS Resolver in this subnet should return synthetic IPv6 addresses for IPv4-only destinations. Default: false.
- 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. Default: false.
- enableResource booleanName Dns Aaaa Record On Launch 
- Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records. Default: false.
- ipv6CidrBlock string
- The IPv6 network range for the subnet, in CIDR notation. The subnet size must use a /64 prefix length.
- ipv6Native boolean
- Indicates whether to create an IPv6-only subnet. Default: false.
- mapCustomer booleanOwned Ip On Launch 
- Specify trueto indicate that network interfaces created in the subnet should be assigned a customer owned IP address. Thecustomer_owned_ipv4_poolandoutpost_arnarguments must be specified when set totrue. Default isfalse.
- mapPublic booleanIp On Launch 
- Specify true to indicate
that instances launched into the subnet should be assigned
a public IP address. Default is false.
- outpostArn string
- The Amazon Resource Name (ARN) of the Outpost.
- privateDns stringHostname Type On Launch 
- The type of hostnames to assign to instances in the subnet at launch. For IPv6-only subnets, an instance DNS name must be based on the instance ID. For dual-stack and IPv4-only subnets, you can specify whether DNS names use the instance IPv4 address or the instance ID. Valid values: ip-name,resource-name.
- region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- {[key: string]: string}
- A map of tags to assign to the resource. .If configured with a provider default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- vpc_id str
- The VPC ID.
- assign_ipv6_ booladdress_ on_ creation 
- Specify true to indicate
that network interfaces created in the specified subnet should be
assigned an IPv6 address. Default is false
- availability_zone str
- AZ for the subnet.
- availability_zone_ strid 
- AZ ID of the subnet. This argument is not supported in all regions or partitions. If necessary, use availability_zoneinstead.
- cidr_block str
- The IPv4 CIDR block for the subnet.
- customer_owned_ stripv4_ pool 
- The customer owned IPv4 address pool. Typically used with the map_customer_owned_ip_on_launchargument. Theoutpost_arnargument must be specified when configured.
- enable_dns64 bool
- Indicates whether DNS queries made to the Amazon-provided DNS Resolver in this subnet should return synthetic IPv6 addresses for IPv4-only destinations. Default: false.
- 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. Default: false.
- enable_resource_ boolname_ dns_ aaaa_ record_ on_ launch 
- Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records. Default: false.
- ipv6_cidr_ strblock 
- The IPv6 network range for the subnet, in CIDR notation. The subnet size must use a /64 prefix length.
- ipv6_native bool
- Indicates whether to create an IPv6-only subnet. Default: false.
- map_customer_ boolowned_ ip_ on_ launch 
- Specify trueto indicate that network interfaces created in the subnet should be assigned a customer owned IP address. Thecustomer_owned_ipv4_poolandoutpost_arnarguments must be specified when set totrue. Default isfalse.
- map_public_ boolip_ on_ launch 
- Specify true to indicate
that instances launched into the subnet should be assigned
a public IP address. Default is false.
- outpost_arn str
- The Amazon Resource Name (ARN) of the Outpost.
- private_dns_ strhostname_ type_ on_ launch 
- The type of hostnames to assign to instances in the subnet at launch. For IPv6-only subnets, an instance DNS name must be based on the instance ID. For dual-stack and IPv4-only subnets, you can specify whether DNS names use the instance IPv4 address or the instance ID. Valid values: ip-name,resource-name.
- region str
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- Mapping[str, str]
- A map of tags to assign to the resource. .If configured with a provider default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- vpcId String
- The VPC ID.
- assignIpv6Address BooleanOn Creation 
- Specify true to indicate
that network interfaces created in the specified subnet should be
assigned an IPv6 address. Default is false
- availabilityZone String
- AZ for the subnet.
- availabilityZone StringId 
- AZ ID of the subnet. This argument is not supported in all regions or partitions. If necessary, use availability_zoneinstead.
- cidrBlock String
- The IPv4 CIDR block for the subnet.
- customerOwned StringIpv4Pool 
- The customer owned IPv4 address pool. Typically used with the map_customer_owned_ip_on_launchargument. Theoutpost_arnargument must be specified when configured.
- enableDns64 Boolean
- Indicates whether DNS queries made to the Amazon-provided DNS Resolver in this subnet should return synthetic IPv6 addresses for IPv4-only destinations. Default: false.
- 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. Default: false.
- enableResource BooleanName Dns Aaaa Record On Launch 
- Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records. Default: false.
- ipv6CidrBlock String
- The IPv6 network range for the subnet, in CIDR notation. The subnet size must use a /64 prefix length.
- ipv6Native Boolean
- Indicates whether to create an IPv6-only subnet. Default: false.
- mapCustomer BooleanOwned Ip On Launch 
- Specify trueto indicate that network interfaces created in the subnet should be assigned a customer owned IP address. Thecustomer_owned_ipv4_poolandoutpost_arnarguments must be specified when set totrue. Default isfalse.
- mapPublic BooleanIp On Launch 
- Specify true to indicate
that instances launched into the subnet should be assigned
a public IP address. Default is false.
- outpostArn String
- The Amazon Resource Name (ARN) of the Outpost.
- privateDns StringHostname Type On Launch 
- The type of hostnames to assign to instances in the subnet at launch. For IPv6-only subnets, an instance DNS name must be based on the instance ID. For dual-stack and IPv4-only subnets, you can specify whether DNS names use the instance IPv4 address or the instance ID. Valid values: ip-name,resource-name.
- region String
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- Map<String>
- A map of tags to assign to the resource. .If configured with a provider default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
Outputs
All input properties are implicitly available as output properties. Additionally, the Subnet resource produces the following output properties:
- Arn string
- The ARN of the subnet.
- Id string
- The provider-assigned unique ID for this managed resource.
- Ipv6CidrBlock stringAssociation Id 
- The association ID for the IPv6 CIDR block.
- OwnerId string
- The ID of the AWS account that owns the subnet.
- Dictionary<string, string>
- A map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
- Arn string
- The ARN of the subnet.
- Id string
- The provider-assigned unique ID for this managed resource.
- Ipv6CidrBlock stringAssociation Id 
- The association ID for the IPv6 CIDR block.
- OwnerId string
- The ID of the AWS account that owns the subnet.
- map[string]string
- A map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
- arn String
- The ARN of the subnet.
- id String
- The provider-assigned unique ID for this managed resource.
- ipv6CidrBlock StringAssociation Id 
- The association ID for the IPv6 CIDR block.
- ownerId String
- The ID of the AWS account that owns the subnet.
- Map<String,String>
- A map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
- arn string
- The ARN of the subnet.
- id string
- The provider-assigned unique ID for this managed resource.
- ipv6CidrBlock stringAssociation Id 
- The association ID for the IPv6 CIDR block.
- ownerId string
- The ID of the AWS account that owns the subnet.
- {[key: string]: string}
- A map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
- arn str
- The ARN of the subnet.
- id str
- The provider-assigned unique ID for this managed resource.
- ipv6_cidr_ strblock_ association_ id 
- The association ID for the IPv6 CIDR block.
- owner_id str
- The ID of the AWS account that owns the subnet.
- Mapping[str, str]
- A map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
- arn String
- The ARN of the subnet.
- id String
- The provider-assigned unique ID for this managed resource.
- ipv6CidrBlock StringAssociation Id 
- The association ID for the IPv6 CIDR block.
- ownerId String
- The ID of the AWS account that owns the subnet.
- Map<String>
- A map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
Look up Existing Subnet Resource
Get an existing Subnet resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: SubnetState, opts?: CustomResourceOptions): Subnet@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        arn: Optional[str] = None,
        assign_ipv6_address_on_creation: Optional[bool] = None,
        availability_zone: Optional[str] = None,
        availability_zone_id: Optional[str] = None,
        cidr_block: Optional[str] = None,
        customer_owned_ipv4_pool: Optional[str] = None,
        enable_dns64: Optional[bool] = None,
        enable_lni_at_device_index: Optional[int] = None,
        enable_resource_name_dns_a_record_on_launch: Optional[bool] = None,
        enable_resource_name_dns_aaaa_record_on_launch: Optional[bool] = None,
        ipv6_cidr_block: Optional[str] = None,
        ipv6_cidr_block_association_id: Optional[str] = None,
        ipv6_native: Optional[bool] = None,
        map_customer_owned_ip_on_launch: Optional[bool] = None,
        map_public_ip_on_launch: Optional[bool] = None,
        outpost_arn: Optional[str] = None,
        owner_id: Optional[str] = None,
        private_dns_hostname_type_on_launch: Optional[str] = None,
        region: Optional[str] = None,
        tags: Optional[Mapping[str, str]] = None,
        tags_all: Optional[Mapping[str, str]] = None,
        vpc_id: Optional[str] = None) -> Subnetfunc GetSubnet(ctx *Context, name string, id IDInput, state *SubnetState, opts ...ResourceOption) (*Subnet, error)public static Subnet Get(string name, Input<string> id, SubnetState? state, CustomResourceOptions? opts = null)public static Subnet get(String name, Output<String> id, SubnetState state, CustomResourceOptions options)resources:  _:    type: aws:ec2:Subnet    get:      id: ${id}- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Arn string
- The ARN of the subnet.
- AssignIpv6Address boolOn Creation 
- Specify true to indicate
that network interfaces created in the specified subnet should be
assigned an IPv6 address. Default is false
- AvailabilityZone string
- AZ for the subnet.
- AvailabilityZone stringId 
- AZ ID of the subnet. This argument is not supported in all regions or partitions. If necessary, use availability_zoneinstead.
- CidrBlock string
- The IPv4 CIDR block for the subnet.
- CustomerOwned stringIpv4Pool 
- The customer owned IPv4 address pool. Typically used with the map_customer_owned_ip_on_launchargument. Theoutpost_arnargument must be specified when configured.
- EnableDns64 bool
- Indicates whether DNS queries made to the Amazon-provided DNS Resolver in this subnet should return synthetic IPv6 addresses for IPv4-only destinations. Default: false.
- 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. Default: false.
- EnableResource boolName Dns Aaaa Record On Launch 
- Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records. Default: false.
- Ipv6CidrBlock string
- The IPv6 network range for the subnet, in CIDR notation. The subnet size must use a /64 prefix length.
- Ipv6CidrBlock stringAssociation Id 
- The association ID for the IPv6 CIDR block.
- Ipv6Native bool
- Indicates whether to create an IPv6-only subnet. Default: false.
- MapCustomer boolOwned Ip On Launch 
- Specify trueto indicate that network interfaces created in the subnet should be assigned a customer owned IP address. Thecustomer_owned_ipv4_poolandoutpost_arnarguments must be specified when set totrue. Default isfalse.
- MapPublic boolIp On Launch 
- Specify true to indicate
that instances launched into the subnet should be assigned
a public IP address. Default is false.
- OutpostArn string
- The Amazon Resource Name (ARN) of the Outpost.
- OwnerId string
- The ID of the AWS account that owns the subnet.
- PrivateDns stringHostname Type On Launch 
- The type of hostnames to assign to instances in the subnet at launch. For IPv6-only subnets, an instance DNS name must be based on the instance ID. For dual-stack and IPv4-only subnets, you can specify whether DNS names use the instance IPv4 address or the instance ID. Valid values: ip-name,resource-name.
- Region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- Dictionary<string, string>
- A map of tags to assign to the resource. .If configured with a provider default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- Dictionary<string, string>
- A map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
- VpcId string
- The VPC ID.
- Arn string
- The ARN of the subnet.
- AssignIpv6Address boolOn Creation 
- Specify true to indicate
that network interfaces created in the specified subnet should be
assigned an IPv6 address. Default is false
- AvailabilityZone string
- AZ for the subnet.
- AvailabilityZone stringId 
- AZ ID of the subnet. This argument is not supported in all regions or partitions. If necessary, use availability_zoneinstead.
- CidrBlock string
- The IPv4 CIDR block for the subnet.
- CustomerOwned stringIpv4Pool 
- The customer owned IPv4 address pool. Typically used with the map_customer_owned_ip_on_launchargument. Theoutpost_arnargument must be specified when configured.
- EnableDns64 bool
- Indicates whether DNS queries made to the Amazon-provided DNS Resolver in this subnet should return synthetic IPv6 addresses for IPv4-only destinations. Default: false.
- 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. Default: false.
- EnableResource boolName Dns Aaaa Record On Launch 
- Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records. Default: false.
- Ipv6CidrBlock string
- The IPv6 network range for the subnet, in CIDR notation. The subnet size must use a /64 prefix length.
- Ipv6CidrBlock stringAssociation Id 
- The association ID for the IPv6 CIDR block.
- Ipv6Native bool
- Indicates whether to create an IPv6-only subnet. Default: false.
- MapCustomer boolOwned Ip On Launch 
- Specify trueto indicate that network interfaces created in the subnet should be assigned a customer owned IP address. Thecustomer_owned_ipv4_poolandoutpost_arnarguments must be specified when set totrue. Default isfalse.
- MapPublic boolIp On Launch 
- Specify true to indicate
that instances launched into the subnet should be assigned
a public IP address. Default is false.
- OutpostArn string
- The Amazon Resource Name (ARN) of the Outpost.
- OwnerId string
- The ID of the AWS account that owns the subnet.
- PrivateDns stringHostname Type On Launch 
- The type of hostnames to assign to instances in the subnet at launch. For IPv6-only subnets, an instance DNS name must be based on the instance ID. For dual-stack and IPv4-only subnets, you can specify whether DNS names use the instance IPv4 address or the instance ID. Valid values: ip-name,resource-name.
- Region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- map[string]string
- A map of tags to assign to the resource. .If configured with a provider default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- map[string]string
- A map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
- VpcId string
- The VPC ID.
- arn String
- The ARN of the subnet.
- assignIpv6Address BooleanOn Creation 
- Specify true to indicate
that network interfaces created in the specified subnet should be
assigned an IPv6 address. Default is false
- availabilityZone String
- AZ for the subnet.
- availabilityZone StringId 
- AZ ID of the subnet. This argument is not supported in all regions or partitions. If necessary, use availability_zoneinstead.
- cidrBlock String
- The IPv4 CIDR block for the subnet.
- customerOwned StringIpv4Pool 
- The customer owned IPv4 address pool. Typically used with the map_customer_owned_ip_on_launchargument. Theoutpost_arnargument must be specified when configured.
- enableDns64 Boolean
- Indicates whether DNS queries made to the Amazon-provided DNS Resolver in this subnet should return synthetic IPv6 addresses for IPv4-only destinations. Default: false.
- 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. Default: false.
- enableResource BooleanName Dns Aaaa Record On Launch 
- Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records. Default: false.
- ipv6CidrBlock String
- The IPv6 network range for the subnet, in CIDR notation. The subnet size must use a /64 prefix length.
- ipv6CidrBlock StringAssociation Id 
- The association ID for the IPv6 CIDR block.
- ipv6Native Boolean
- Indicates whether to create an IPv6-only subnet. Default: false.
- mapCustomer BooleanOwned Ip On Launch 
- Specify trueto indicate that network interfaces created in the subnet should be assigned a customer owned IP address. Thecustomer_owned_ipv4_poolandoutpost_arnarguments must be specified when set totrue. Default isfalse.
- mapPublic BooleanIp On Launch 
- Specify true to indicate
that instances launched into the subnet should be assigned
a public IP address. Default is false.
- outpostArn String
- The Amazon Resource Name (ARN) of the Outpost.
- ownerId String
- The ID of the AWS account that owns the subnet.
- privateDns StringHostname Type On Launch 
- The type of hostnames to assign to instances in the subnet at launch. For IPv6-only subnets, an instance DNS name must be based on the instance ID. For dual-stack and IPv4-only subnets, you can specify whether DNS names use the instance IPv4 address or the instance ID. Valid values: ip-name,resource-name.
- region String
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- Map<String,String>
- A map of tags to assign to the resource. .If configured with a provider default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- Map<String,String>
- A map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
- vpcId String
- The VPC ID.
- arn string
- The ARN of the subnet.
- assignIpv6Address booleanOn Creation 
- Specify true to indicate
that network interfaces created in the specified subnet should be
assigned an IPv6 address. Default is false
- availabilityZone string
- AZ for the subnet.
- availabilityZone stringId 
- AZ ID of the subnet. This argument is not supported in all regions or partitions. If necessary, use availability_zoneinstead.
- cidrBlock string
- The IPv4 CIDR block for the subnet.
- customerOwned stringIpv4Pool 
- The customer owned IPv4 address pool. Typically used with the map_customer_owned_ip_on_launchargument. Theoutpost_arnargument must be specified when configured.
- enableDns64 boolean
- Indicates whether DNS queries made to the Amazon-provided DNS Resolver in this subnet should return synthetic IPv6 addresses for IPv4-only destinations. Default: false.
- 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. Default: false.
- enableResource booleanName Dns Aaaa Record On Launch 
- Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records. Default: false.
- ipv6CidrBlock string
- The IPv6 network range for the subnet, in CIDR notation. The subnet size must use a /64 prefix length.
- ipv6CidrBlock stringAssociation Id 
- The association ID for the IPv6 CIDR block.
- ipv6Native boolean
- Indicates whether to create an IPv6-only subnet. Default: false.
- mapCustomer booleanOwned Ip On Launch 
- Specify trueto indicate that network interfaces created in the subnet should be assigned a customer owned IP address. Thecustomer_owned_ipv4_poolandoutpost_arnarguments must be specified when set totrue. Default isfalse.
- mapPublic booleanIp On Launch 
- Specify true to indicate
that instances launched into the subnet should be assigned
a public IP address. Default is false.
- outpostArn string
- The Amazon Resource Name (ARN) of the Outpost.
- ownerId string
- The ID of the AWS account that owns the subnet.
- privateDns stringHostname Type On Launch 
- The type of hostnames to assign to instances in the subnet at launch. For IPv6-only subnets, an instance DNS name must be based on the instance ID. For dual-stack and IPv4-only subnets, you can specify whether DNS names use the instance IPv4 address or the instance ID. Valid values: ip-name,resource-name.
- region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- {[key: string]: string}
- A map of tags to assign to the resource. .If configured with a provider default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- {[key: string]: string}
- A map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
- vpcId string
- The VPC ID.
- arn str
- The ARN of the subnet.
- assign_ipv6_ booladdress_ on_ creation 
- Specify true to indicate
that network interfaces created in the specified subnet should be
assigned an IPv6 address. Default is false
- availability_zone str
- AZ for the subnet.
- availability_zone_ strid 
- AZ ID of the subnet. This argument is not supported in all regions or partitions. If necessary, use availability_zoneinstead.
- cidr_block str
- The IPv4 CIDR block for the subnet.
- customer_owned_ stripv4_ pool 
- The customer owned IPv4 address pool. Typically used with the map_customer_owned_ip_on_launchargument. Theoutpost_arnargument must be specified when configured.
- enable_dns64 bool
- Indicates whether DNS queries made to the Amazon-provided DNS Resolver in this subnet should return synthetic IPv6 addresses for IPv4-only destinations. Default: false.
- 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. Default: false.
- enable_resource_ boolname_ dns_ aaaa_ record_ on_ launch 
- Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records. Default: false.
- ipv6_cidr_ strblock 
- The IPv6 network range for the subnet, in CIDR notation. The subnet size must use a /64 prefix length.
- ipv6_cidr_ strblock_ association_ id 
- The association ID for the IPv6 CIDR block.
- ipv6_native bool
- Indicates whether to create an IPv6-only subnet. Default: false.
- map_customer_ boolowned_ ip_ on_ launch 
- Specify trueto indicate that network interfaces created in the subnet should be assigned a customer owned IP address. Thecustomer_owned_ipv4_poolandoutpost_arnarguments must be specified when set totrue. Default isfalse.
- map_public_ boolip_ on_ launch 
- Specify true to indicate
that instances launched into the subnet should be assigned
a public IP address. Default is false.
- outpost_arn str
- The Amazon Resource Name (ARN) of the Outpost.
- owner_id str
- The ID of the AWS account that owns the subnet.
- private_dns_ strhostname_ type_ on_ launch 
- The type of hostnames to assign to instances in the subnet at launch. For IPv6-only subnets, an instance DNS name must be based on the instance ID. For dual-stack and IPv4-only subnets, you can specify whether DNS names use the instance IPv4 address or the instance ID. Valid values: ip-name,resource-name.
- region str
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- Mapping[str, str]
- A map of tags to assign to the resource. .If configured with a provider default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- Mapping[str, str]
- A map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
- vpc_id str
- The VPC ID.
- arn String
- The ARN of the subnet.
- assignIpv6Address BooleanOn Creation 
- Specify true to indicate
that network interfaces created in the specified subnet should be
assigned an IPv6 address. Default is false
- availabilityZone String
- AZ for the subnet.
- availabilityZone StringId 
- AZ ID of the subnet. This argument is not supported in all regions or partitions. If necessary, use availability_zoneinstead.
- cidrBlock String
- The IPv4 CIDR block for the subnet.
- customerOwned StringIpv4Pool 
- The customer owned IPv4 address pool. Typically used with the map_customer_owned_ip_on_launchargument. Theoutpost_arnargument must be specified when configured.
- enableDns64 Boolean
- Indicates whether DNS queries made to the Amazon-provided DNS Resolver in this subnet should return synthetic IPv6 addresses for IPv4-only destinations. Default: false.
- 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. Default: false.
- enableResource BooleanName Dns Aaaa Record On Launch 
- Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records. Default: false.
- ipv6CidrBlock String
- The IPv6 network range for the subnet, in CIDR notation. The subnet size must use a /64 prefix length.
- ipv6CidrBlock StringAssociation Id 
- The association ID for the IPv6 CIDR block.
- ipv6Native Boolean
- Indicates whether to create an IPv6-only subnet. Default: false.
- mapCustomer BooleanOwned Ip On Launch 
- Specify trueto indicate that network interfaces created in the subnet should be assigned a customer owned IP address. Thecustomer_owned_ipv4_poolandoutpost_arnarguments must be specified when set totrue. Default isfalse.
- mapPublic BooleanIp On Launch 
- Specify true to indicate
that instances launched into the subnet should be assigned
a public IP address. Default is false.
- outpostArn String
- The Amazon Resource Name (ARN) of the Outpost.
- ownerId String
- The ID of the AWS account that owns the subnet.
- privateDns StringHostname Type On Launch 
- The type of hostnames to assign to instances in the subnet at launch. For IPv6-only subnets, an instance DNS name must be based on the instance ID. For dual-stack and IPv4-only subnets, you can specify whether DNS names use the instance IPv4 address or the instance ID. Valid values: ip-name,resource-name.
- region String
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- Map<String>
- A map of tags to assign to the resource. .If configured with a provider default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- Map<String>
- A map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
- vpcId String
- The VPC ID.
Import
Identity Schema
Required
- id(String) ID of the subnet.
Optional
- account_id(String) AWS Account where this resource is managed.
- region(String) Region where this resource is managed.
Using pulumi import, import subnets using the subnet id. For example:
console
% pulumi import aws_subnet.example subnet-9d4a7b6c
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the awsTerraform Provider.
