aws.ec2.DefaultSubnet
Explore with Pulumi AI
Provides a resource to manage a default subnet in the current region.
This is an advanced resource and has special caveats to be aware of when using it. Please read this document in its entirety before using this resource.
The aws.ec2.DefaultSubnet resource behaves differently from normal resources in that if a default subnet exists in the specified Availability Zone, this provider does not create this resource, but instead “adopts” it into management.
If no default subnet exists, this provider creates a new default subnet.
By default, pulumi destroy does not delete the default subnet but does remove the resource from the state.
Set the force_destroy argument to true to delete the default subnet.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const defaultAz1 = new aws.ec2.DefaultSubnet("default_az1", {
    availabilityZone: "us-west-2a",
    tags: {
        Name: "Default subnet for us-west-2a",
    },
});
import pulumi
import pulumi_aws as aws
default_az1 = aws.ec2.DefaultSubnet("default_az1",
    availability_zone="us-west-2a",
    tags={
        "Name": "Default subnet for us-west-2a",
    })
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.NewDefaultSubnet(ctx, "default_az1", &ec2.DefaultSubnetArgs{
			AvailabilityZone: pulumi.String("us-west-2a"),
			Tags: pulumi.StringMap{
				"Name": pulumi.String("Default subnet for us-west-2a"),
			},
		})
		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 defaultAz1 = new Aws.Ec2.DefaultSubnet("default_az1", new()
    {
        AvailabilityZone = "us-west-2a",
        Tags = 
        {
            { "Name", "Default subnet for us-west-2a" },
        },
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ec2.DefaultSubnet;
import com.pulumi.aws.ec2.DefaultSubnetArgs;
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 defaultAz1 = new DefaultSubnet("defaultAz1", DefaultSubnetArgs.builder()
            .availabilityZone("us-west-2a")
            .tags(Map.of("Name", "Default subnet for us-west-2a"))
            .build());
    }
}
resources:
  defaultAz1:
    type: aws:ec2:DefaultSubnet
    name: default_az1
    properties:
      availabilityZone: us-west-2a
      tags:
        Name: Default subnet for us-west-2a
Create DefaultSubnet Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new DefaultSubnet(name: string, args: DefaultSubnetArgs, opts?: CustomResourceOptions);@overload
def DefaultSubnet(resource_name: str,
                  args: DefaultSubnetArgs,
                  opts: Optional[ResourceOptions] = None)
@overload
def DefaultSubnet(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  availability_zone: Optional[str] = None,
                  force_destroy: Optional[bool] = None,
                  customer_owned_ipv4_pool: Optional[str] = None,
                  enable_dns64: Optional[bool] = None,
                  enable_resource_name_dns_a_record_on_launch: Optional[bool] = None,
                  enable_resource_name_dns_aaaa_record_on_launch: Optional[bool] = None,
                  assign_ipv6_address_on_creation: Optional[bool] = None,
                  ipv6_cidr_block: 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,
                  private_dns_hostname_type_on_launch: Optional[str] = None,
                  tags: Optional[Mapping[str, str]] = None)func NewDefaultSubnet(ctx *Context, name string, args DefaultSubnetArgs, opts ...ResourceOption) (*DefaultSubnet, error)public DefaultSubnet(string name, DefaultSubnetArgs args, CustomResourceOptions? opts = null)
public DefaultSubnet(String name, DefaultSubnetArgs args)
public DefaultSubnet(String name, DefaultSubnetArgs args, CustomResourceOptions options)
type: aws:ec2:DefaultSubnet
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 DefaultSubnetArgs
- 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 DefaultSubnetArgs
- 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 DefaultSubnetArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DefaultSubnetArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args DefaultSubnetArgs
- 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 defaultSubnetResource = new Aws.Ec2.DefaultSubnet("defaultSubnetResource", new()
{
    AvailabilityZone = "string",
    ForceDestroy = false,
    CustomerOwnedIpv4Pool = "string",
    EnableDns64 = false,
    EnableResourceNameDnsARecordOnLaunch = false,
    EnableResourceNameDnsAaaaRecordOnLaunch = false,
    AssignIpv6AddressOnCreation = false,
    Ipv6CidrBlock = "string",
    Ipv6Native = false,
    MapCustomerOwnedIpOnLaunch = false,
    MapPublicIpOnLaunch = false,
    PrivateDnsHostnameTypeOnLaunch = "string",
    Tags = 
    {
        { "string", "string" },
    },
});
example, err := ec2.NewDefaultSubnet(ctx, "defaultSubnetResource", &ec2.DefaultSubnetArgs{
	AvailabilityZone:                        pulumi.String("string"),
	ForceDestroy:                            pulumi.Bool(false),
	CustomerOwnedIpv4Pool:                   pulumi.String("string"),
	EnableDns64:                             pulumi.Bool(false),
	EnableResourceNameDnsARecordOnLaunch:    pulumi.Bool(false),
	EnableResourceNameDnsAaaaRecordOnLaunch: pulumi.Bool(false),
	AssignIpv6AddressOnCreation:             pulumi.Bool(false),
	Ipv6CidrBlock:                           pulumi.String("string"),
	Ipv6Native:                              pulumi.Bool(false),
	MapCustomerOwnedIpOnLaunch:              pulumi.Bool(false),
	MapPublicIpOnLaunch:                     pulumi.Bool(false),
	PrivateDnsHostnameTypeOnLaunch:          pulumi.String("string"),
	Tags: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
})
var defaultSubnetResource = new DefaultSubnet("defaultSubnetResource", DefaultSubnetArgs.builder()
    .availabilityZone("string")
    .forceDestroy(false)
    .customerOwnedIpv4Pool("string")
    .enableDns64(false)
    .enableResourceNameDnsARecordOnLaunch(false)
    .enableResourceNameDnsAaaaRecordOnLaunch(false)
    .assignIpv6AddressOnCreation(false)
    .ipv6CidrBlock("string")
    .ipv6Native(false)
    .mapCustomerOwnedIpOnLaunch(false)
    .mapPublicIpOnLaunch(false)
    .privateDnsHostnameTypeOnLaunch("string")
    .tags(Map.of("string", "string"))
    .build());
default_subnet_resource = aws.ec2.DefaultSubnet("defaultSubnetResource",
    availability_zone="string",
    force_destroy=False,
    customer_owned_ipv4_pool="string",
    enable_dns64=False,
    enable_resource_name_dns_a_record_on_launch=False,
    enable_resource_name_dns_aaaa_record_on_launch=False,
    assign_ipv6_address_on_creation=False,
    ipv6_cidr_block="string",
    ipv6_native=False,
    map_customer_owned_ip_on_launch=False,
    map_public_ip_on_launch=False,
    private_dns_hostname_type_on_launch="string",
    tags={
        "string": "string",
    })
const defaultSubnetResource = new aws.ec2.DefaultSubnet("defaultSubnetResource", {
    availabilityZone: "string",
    forceDestroy: false,
    customerOwnedIpv4Pool: "string",
    enableDns64: false,
    enableResourceNameDnsARecordOnLaunch: false,
    enableResourceNameDnsAaaaRecordOnLaunch: false,
    assignIpv6AddressOnCreation: false,
    ipv6CidrBlock: "string",
    ipv6Native: false,
    mapCustomerOwnedIpOnLaunch: false,
    mapPublicIpOnLaunch: false,
    privateDnsHostnameTypeOnLaunch: "string",
    tags: {
        string: "string",
    },
});
type: aws:ec2:DefaultSubnet
properties:
    assignIpv6AddressOnCreation: false
    availabilityZone: string
    customerOwnedIpv4Pool: string
    enableDns64: false
    enableResourceNameDnsARecordOnLaunch: false
    enableResourceNameDnsAaaaRecordOnLaunch: false
    forceDestroy: false
    ipv6CidrBlock: string
    ipv6Native: false
    mapCustomerOwnedIpOnLaunch: false
    mapPublicIpOnLaunch: false
    privateDnsHostnameTypeOnLaunch: string
    tags:
        string: string
DefaultSubnet 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 DefaultSubnet resource accepts the following input properties:
- AvailabilityZone string
- is required - The availability_zone_id,cidr_blockandvpc_idarguments become computed attributes
- The default value for map_public_ip_on_launchistrue
 - This resource supports the following additional arguments: 
- The 
- AssignIpv6Address boolOn Creation 
- CustomerOwned stringIpv4Pool 
- EnableDns64 bool
- EnableResource boolName Dns ARecord On Launch 
- EnableResource boolName Dns Aaaa Record On Launch 
- ForceDestroy bool
- Whether destroying the resource deletes the default subnet. Default: false
- Ipv6CidrBlock string
- Ipv6Native bool
- MapCustomer boolOwned Ip On Launch 
- MapPublic boolIp On Launch 
- PrivateDns stringHostname Type On Launch 
- Dictionary<string, string>
- AvailabilityZone string
- is required - The availability_zone_id,cidr_blockandvpc_idarguments become computed attributes
- The default value for map_public_ip_on_launchistrue
 - This resource supports the following additional arguments: 
- The 
- AssignIpv6Address boolOn Creation 
- CustomerOwned stringIpv4Pool 
- EnableDns64 bool
- EnableResource boolName Dns ARecord On Launch 
- EnableResource boolName Dns Aaaa Record On Launch 
- ForceDestroy bool
- Whether destroying the resource deletes the default subnet. Default: false
- Ipv6CidrBlock string
- Ipv6Native bool
- MapCustomer boolOwned Ip On Launch 
- MapPublic boolIp On Launch 
- PrivateDns stringHostname Type On Launch 
- map[string]string
- availabilityZone String
- is required - The availability_zone_id,cidr_blockandvpc_idarguments become computed attributes
- The default value for map_public_ip_on_launchistrue
 - This resource supports the following additional arguments: 
- The 
- assignIpv6Address BooleanOn Creation 
- customerOwned StringIpv4Pool 
- enableDns64 Boolean
- enableResource BooleanName Dns ARecord On Launch 
- enableResource BooleanName Dns Aaaa Record On Launch 
- forceDestroy Boolean
- Whether destroying the resource deletes the default subnet. Default: false
- ipv6CidrBlock String
- ipv6Native Boolean
- mapCustomer BooleanOwned Ip On Launch 
- mapPublic BooleanIp On Launch 
- privateDns StringHostname Type On Launch 
- Map<String,String>
- availabilityZone string
- is required - The availability_zone_id,cidr_blockandvpc_idarguments become computed attributes
- The default value for map_public_ip_on_launchistrue
 - This resource supports the following additional arguments: 
- The 
- assignIpv6Address booleanOn Creation 
- customerOwned stringIpv4Pool 
- enableDns64 boolean
- enableResource booleanName Dns ARecord On Launch 
- enableResource booleanName Dns Aaaa Record On Launch 
- forceDestroy boolean
- Whether destroying the resource deletes the default subnet. Default: false
- ipv6CidrBlock string
- ipv6Native boolean
- mapCustomer booleanOwned Ip On Launch 
- mapPublic booleanIp On Launch 
- privateDns stringHostname Type On Launch 
- {[key: string]: string}
- availability_zone str
- is required - The availability_zone_id,cidr_blockandvpc_idarguments become computed attributes
- The default value for map_public_ip_on_launchistrue
 - This resource supports the following additional arguments: 
- The 
- assign_ipv6_ booladdress_ on_ creation 
- customer_owned_ stripv4_ pool 
- enable_dns64 bool
- enable_resource_ boolname_ dns_ a_ record_ on_ launch 
- enable_resource_ boolname_ dns_ aaaa_ record_ on_ launch 
- force_destroy bool
- Whether destroying the resource deletes the default subnet. Default: false
- ipv6_cidr_ strblock 
- ipv6_native bool
- map_customer_ boolowned_ ip_ on_ launch 
- map_public_ boolip_ on_ launch 
- private_dns_ strhostname_ type_ on_ launch 
- Mapping[str, str]
- availabilityZone String
- is required - The availability_zone_id,cidr_blockandvpc_idarguments become computed attributes
- The default value for map_public_ip_on_launchistrue
 - This resource supports the following additional arguments: 
- The 
- assignIpv6Address BooleanOn Creation 
- customerOwned StringIpv4Pool 
- enableDns64 Boolean
- enableResource BooleanName Dns ARecord On Launch 
- enableResource BooleanName Dns Aaaa Record On Launch 
- forceDestroy Boolean
- Whether destroying the resource deletes the default subnet. Default: false
- ipv6CidrBlock String
- ipv6Native Boolean
- mapCustomer BooleanOwned Ip On Launch 
- mapPublic BooleanIp On Launch 
- privateDns StringHostname Type On Launch 
- Map<String>
Outputs
All input properties are implicitly available as output properties. Additionally, the DefaultSubnet resource produces the following output properties:
- Arn string
- AvailabilityZone stringId 
- The AZ ID of the subnet
- CidrBlock string
- The IPv4 CIDR block assigned to the subnet
- EnableLni intAt Device Index 
- ExistingDefault boolSubnet 
- Id string
- The provider-assigned unique ID for this managed resource.
- Ipv6CidrBlock stringAssociation Id 
- OutpostArn string
- OwnerId string
- Dictionary<string, string>
- VpcId string
- The ID of the VPC the subnet is in
- Arn string
- AvailabilityZone stringId 
- The AZ ID of the subnet
- CidrBlock string
- The IPv4 CIDR block assigned to the subnet
- EnableLni intAt Device Index 
- ExistingDefault boolSubnet 
- Id string
- The provider-assigned unique ID for this managed resource.
- Ipv6CidrBlock stringAssociation Id 
- OutpostArn string
- OwnerId string
- map[string]string
- VpcId string
- The ID of the VPC the subnet is in
- arn String
- availabilityZone StringId 
- The AZ ID of the subnet
- cidrBlock String
- The IPv4 CIDR block assigned to the subnet
- enableLni IntegerAt Device Index 
- existingDefault BooleanSubnet 
- id String
- The provider-assigned unique ID for this managed resource.
- ipv6CidrBlock StringAssociation Id 
- outpostArn String
- ownerId String
- Map<String,String>
- vpcId String
- The ID of the VPC the subnet is in
- arn string
- availabilityZone stringId 
- The AZ ID of the subnet
- cidrBlock string
- The IPv4 CIDR block assigned to the subnet
- enableLni numberAt Device Index 
- existingDefault booleanSubnet 
- id string
- The provider-assigned unique ID for this managed resource.
- ipv6CidrBlock stringAssociation Id 
- outpostArn string
- ownerId string
- {[key: string]: string}
- vpcId string
- The ID of the VPC the subnet is in
- arn str
- availability_zone_ strid 
- The AZ ID of the subnet
- cidr_block str
- The IPv4 CIDR block assigned to the subnet
- enable_lni_ intat_ device_ index 
- existing_default_ boolsubnet 
- id str
- The provider-assigned unique ID for this managed resource.
- ipv6_cidr_ strblock_ association_ id 
- outpost_arn str
- owner_id str
- Mapping[str, str]
- vpc_id str
- The ID of the VPC the subnet is in
- arn String
- availabilityZone StringId 
- The AZ ID of the subnet
- cidrBlock String
- The IPv4 CIDR block assigned to the subnet
- enableLni NumberAt Device Index 
- existingDefault BooleanSubnet 
- id String
- The provider-assigned unique ID for this managed resource.
- ipv6CidrBlock StringAssociation Id 
- outpostArn String
- ownerId String
- Map<String>
- vpcId String
- The ID of the VPC the subnet is in
Look up Existing DefaultSubnet Resource
Get an existing DefaultSubnet 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?: DefaultSubnetState, opts?: CustomResourceOptions): DefaultSubnet@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,
        existing_default_subnet: Optional[bool] = None,
        force_destroy: 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,
        tags: Optional[Mapping[str, str]] = None,
        tags_all: Optional[Mapping[str, str]] = None,
        vpc_id: Optional[str] = None) -> DefaultSubnetfunc GetDefaultSubnet(ctx *Context, name string, id IDInput, state *DefaultSubnetState, opts ...ResourceOption) (*DefaultSubnet, error)public static DefaultSubnet Get(string name, Input<string> id, DefaultSubnetState? state, CustomResourceOptions? opts = null)public static DefaultSubnet get(String name, Output<String> id, DefaultSubnetState state, CustomResourceOptions options)resources:  _:    type: aws:ec2:DefaultSubnet    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
- AssignIpv6Address boolOn Creation 
- AvailabilityZone string
- is required - The availability_zone_id,cidr_blockandvpc_idarguments become computed attributes
- The default value for map_public_ip_on_launchistrue
 - This resource supports the following additional arguments: 
- The 
- AvailabilityZone stringId 
- The AZ ID of the subnet
- CidrBlock string
- The IPv4 CIDR block assigned to the subnet
- CustomerOwned stringIpv4Pool 
- EnableDns64 bool
- EnableLni intAt Device Index 
- EnableResource boolName Dns ARecord On Launch 
- EnableResource boolName Dns Aaaa Record On Launch 
- ExistingDefault boolSubnet 
- ForceDestroy bool
- Whether destroying the resource deletes the default subnet. Default: false
- Ipv6CidrBlock string
- Ipv6CidrBlock stringAssociation Id 
- Ipv6Native bool
- MapCustomer boolOwned Ip On Launch 
- MapPublic boolIp On Launch 
- OutpostArn string
- OwnerId string
- PrivateDns stringHostname Type On Launch 
- Dictionary<string, string>
- Dictionary<string, string>
- VpcId string
- The ID of the VPC the subnet is in
- Arn string
- AssignIpv6Address boolOn Creation 
- AvailabilityZone string
- is required - The availability_zone_id,cidr_blockandvpc_idarguments become computed attributes
- The default value for map_public_ip_on_launchistrue
 - This resource supports the following additional arguments: 
- The 
- AvailabilityZone stringId 
- The AZ ID of the subnet
- CidrBlock string
- The IPv4 CIDR block assigned to the subnet
- CustomerOwned stringIpv4Pool 
- EnableDns64 bool
- EnableLni intAt Device Index 
- EnableResource boolName Dns ARecord On Launch 
- EnableResource boolName Dns Aaaa Record On Launch 
- ExistingDefault boolSubnet 
- ForceDestroy bool
- Whether destroying the resource deletes the default subnet. Default: false
- Ipv6CidrBlock string
- Ipv6CidrBlock stringAssociation Id 
- Ipv6Native bool
- MapCustomer boolOwned Ip On Launch 
- MapPublic boolIp On Launch 
- OutpostArn string
- OwnerId string
- PrivateDns stringHostname Type On Launch 
- map[string]string
- map[string]string
- VpcId string
- The ID of the VPC the subnet is in
- arn String
- assignIpv6Address BooleanOn Creation 
- availabilityZone String
- is required - The availability_zone_id,cidr_blockandvpc_idarguments become computed attributes
- The default value for map_public_ip_on_launchistrue
 - This resource supports the following additional arguments: 
- The 
- availabilityZone StringId 
- The AZ ID of the subnet
- cidrBlock String
- The IPv4 CIDR block assigned to the subnet
- customerOwned StringIpv4Pool 
- enableDns64 Boolean
- enableLni IntegerAt Device Index 
- enableResource BooleanName Dns ARecord On Launch 
- enableResource BooleanName Dns Aaaa Record On Launch 
- existingDefault BooleanSubnet 
- forceDestroy Boolean
- Whether destroying the resource deletes the default subnet. Default: false
- ipv6CidrBlock String
- ipv6CidrBlock StringAssociation Id 
- ipv6Native Boolean
- mapCustomer BooleanOwned Ip On Launch 
- mapPublic BooleanIp On Launch 
- outpostArn String
- ownerId String
- privateDns StringHostname Type On Launch 
- Map<String,String>
- Map<String,String>
- vpcId String
- The ID of the VPC the subnet is in
- arn string
- assignIpv6Address booleanOn Creation 
- availabilityZone string
- is required - The availability_zone_id,cidr_blockandvpc_idarguments become computed attributes
- The default value for map_public_ip_on_launchistrue
 - This resource supports the following additional arguments: 
- The 
- availabilityZone stringId 
- The AZ ID of the subnet
- cidrBlock string
- The IPv4 CIDR block assigned to the subnet
- customerOwned stringIpv4Pool 
- enableDns64 boolean
- enableLni numberAt Device Index 
- enableResource booleanName Dns ARecord On Launch 
- enableResource booleanName Dns Aaaa Record On Launch 
- existingDefault booleanSubnet 
- forceDestroy boolean
- Whether destroying the resource deletes the default subnet. Default: false
- ipv6CidrBlock string
- ipv6CidrBlock stringAssociation Id 
- ipv6Native boolean
- mapCustomer booleanOwned Ip On Launch 
- mapPublic booleanIp On Launch 
- outpostArn string
- ownerId string
- privateDns stringHostname Type On Launch 
- {[key: string]: string}
- {[key: string]: string}
- vpcId string
- The ID of the VPC the subnet is in
- arn str
- assign_ipv6_ booladdress_ on_ creation 
- availability_zone str
- is required - The availability_zone_id,cidr_blockandvpc_idarguments become computed attributes
- The default value for map_public_ip_on_launchistrue
 - This resource supports the following additional arguments: 
- The 
- availability_zone_ strid 
- The AZ ID of the subnet
- cidr_block str
- The IPv4 CIDR block assigned to the subnet
- customer_owned_ stripv4_ pool 
- enable_dns64 bool
- enable_lni_ intat_ device_ index 
- enable_resource_ boolname_ dns_ a_ record_ on_ launch 
- enable_resource_ boolname_ dns_ aaaa_ record_ on_ launch 
- existing_default_ boolsubnet 
- force_destroy bool
- Whether destroying the resource deletes the default subnet. Default: false
- ipv6_cidr_ strblock 
- ipv6_cidr_ strblock_ association_ id 
- ipv6_native bool
- map_customer_ boolowned_ ip_ on_ launch 
- map_public_ boolip_ on_ launch 
- outpost_arn str
- owner_id str
- private_dns_ strhostname_ type_ on_ launch 
- Mapping[str, str]
- Mapping[str, str]
- vpc_id str
- The ID of the VPC the subnet is in
- arn String
- assignIpv6Address BooleanOn Creation 
- availabilityZone String
- is required - The availability_zone_id,cidr_blockandvpc_idarguments become computed attributes
- The default value for map_public_ip_on_launchistrue
 - This resource supports the following additional arguments: 
- The 
- availabilityZone StringId 
- The AZ ID of the subnet
- cidrBlock String
- The IPv4 CIDR block assigned to the subnet
- customerOwned StringIpv4Pool 
- enableDns64 Boolean
- enableLni NumberAt Device Index 
- enableResource BooleanName Dns ARecord On Launch 
- enableResource BooleanName Dns Aaaa Record On Launch 
- existingDefault BooleanSubnet 
- forceDestroy Boolean
- Whether destroying the resource deletes the default subnet. Default: false
- ipv6CidrBlock String
- ipv6CidrBlock StringAssociation Id 
- ipv6Native Boolean
- mapCustomer BooleanOwned Ip On Launch 
- mapPublic BooleanIp On Launch 
- outpostArn String
- ownerId String
- privateDns StringHostname Type On Launch 
- Map<String>
- Map<String>
- vpcId String
- The ID of the VPC the subnet is in
Import
Using pulumi import, import subnets using the subnet id. For example:
$ pulumi import aws:ec2/defaultSubnet:DefaultSubnet public_subnet 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.