Try AWS Native preview for resources not in the classic version.
aws.ec2.DefaultSubnet
Explore with Pulumi AI
Try AWS Native preview for resources not in the classic version.
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
The DefaultSubnet resource accepts the following input properties:
- Availability
Zone string is required
- The
availability_zone_id
,cidr_block
andvpc_id
arguments become computed attributes - The default value for
map_public_ip_on_launch
istrue
This resource supports the following additional arguments:
- The
- Assign
Ipv6Address boolOn Creation - Customer
Owned stringIpv4Pool - Enable
Dns64 bool - Enable
Resource boolName Dns ARecord On Launch - Enable
Resource boolName Dns Aaaa Record On Launch - Force
Destroy bool - Whether destroying the resource deletes the default subnet. Default:
false
- Ipv6Cidr
Block string - Ipv6Native bool
- Map
Customer boolOwned Ip On Launch - Map
Public boolIp On Launch - Private
Dns stringHostname Type On Launch - Dictionary<string, string>
- Availability
Zone string is required
- The
availability_zone_id
,cidr_block
andvpc_id
arguments become computed attributes - The default value for
map_public_ip_on_launch
istrue
This resource supports the following additional arguments:
- The
- Assign
Ipv6Address boolOn Creation - Customer
Owned stringIpv4Pool - Enable
Dns64 bool - Enable
Resource boolName Dns ARecord On Launch - Enable
Resource boolName Dns Aaaa Record On Launch - Force
Destroy bool - Whether destroying the resource deletes the default subnet. Default:
false
- Ipv6Cidr
Block string - Ipv6Native bool
- Map
Customer boolOwned Ip On Launch - Map
Public boolIp On Launch - Private
Dns stringHostname Type On Launch - map[string]string
- availability
Zone String is required
- The
availability_zone_id
,cidr_block
andvpc_id
arguments become computed attributes - The default value for
map_public_ip_on_launch
istrue
This resource supports the following additional arguments:
- The
- assign
Ipv6Address BooleanOn Creation - customer
Owned StringIpv4Pool - enable
Dns64 Boolean - enable
Resource BooleanName Dns ARecord On Launch - enable
Resource BooleanName Dns Aaaa Record On Launch - force
Destroy Boolean - Whether destroying the resource deletes the default subnet. Default:
false
- ipv6Cidr
Block String - ipv6Native Boolean
- map
Customer BooleanOwned Ip On Launch - map
Public BooleanIp On Launch - private
Dns StringHostname Type On Launch - Map<String,String>
- availability
Zone string is required
- The
availability_zone_id
,cidr_block
andvpc_id
arguments become computed attributes - The default value for
map_public_ip_on_launch
istrue
This resource supports the following additional arguments:
- The
- assign
Ipv6Address booleanOn Creation - customer
Owned stringIpv4Pool - enable
Dns64 boolean - enable
Resource booleanName Dns ARecord On Launch - enable
Resource booleanName Dns Aaaa Record On Launch - force
Destroy boolean - Whether destroying the resource deletes the default subnet. Default:
false
- ipv6Cidr
Block string - ipv6Native boolean
- map
Customer booleanOwned Ip On Launch - map
Public booleanIp On Launch - private
Dns stringHostname Type On Launch - {[key: string]: string}
- availability_
zone str is required
- The
availability_zone_id
,cidr_block
andvpc_id
arguments become computed attributes - The default value for
map_public_ip_on_launch
istrue
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]
- availability
Zone String is required
- The
availability_zone_id
,cidr_block
andvpc_id
arguments become computed attributes - The default value for
map_public_ip_on_launch
istrue
This resource supports the following additional arguments:
- The
- assign
Ipv6Address BooleanOn Creation - customer
Owned StringIpv4Pool - enable
Dns64 Boolean - enable
Resource BooleanName Dns ARecord On Launch - enable
Resource BooleanName Dns Aaaa Record On Launch - force
Destroy Boolean - Whether destroying the resource deletes the default subnet. Default:
false
- ipv6Cidr
Block String - ipv6Native Boolean
- map
Customer BooleanOwned Ip On Launch - map
Public BooleanIp On Launch - private
Dns 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
- Availability
Zone stringId - The AZ ID of the subnet
- Cidr
Block string - The IPv4 CIDR block assigned to the subnet
- Enable
Lni intAt Device Index - Existing
Default boolSubnet - Id string
- The provider-assigned unique ID for this managed resource.
- Ipv6Cidr
Block stringAssociation Id - Outpost
Arn string - Owner
Id string - Dictionary<string, string>
- Vpc
Id string - The ID of the VPC the subnet is in
- Arn string
- Availability
Zone stringId - The AZ ID of the subnet
- Cidr
Block string - The IPv4 CIDR block assigned to the subnet
- Enable
Lni intAt Device Index - Existing
Default boolSubnet - Id string
- The provider-assigned unique ID for this managed resource.
- Ipv6Cidr
Block stringAssociation Id - Outpost
Arn string - Owner
Id string - map[string]string
- Vpc
Id string - The ID of the VPC the subnet is in
- arn String
- availability
Zone StringId - The AZ ID of the subnet
- cidr
Block String - The IPv4 CIDR block assigned to the subnet
- enable
Lni IntegerAt Device Index - existing
Default BooleanSubnet - id String
- The provider-assigned unique ID for this managed resource.
- ipv6Cidr
Block StringAssociation Id - outpost
Arn String - owner
Id String - Map<String,String>
- vpc
Id String - The ID of the VPC the subnet is in
- arn string
- availability
Zone stringId - The AZ ID of the subnet
- cidr
Block string - The IPv4 CIDR block assigned to the subnet
- enable
Lni numberAt Device Index - existing
Default booleanSubnet - id string
- The provider-assigned unique ID for this managed resource.
- ipv6Cidr
Block stringAssociation Id - outpost
Arn string - owner
Id string - {[key: string]: string}
- vpc
Id 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
- availability
Zone StringId - The AZ ID of the subnet
- cidr
Block String - The IPv4 CIDR block assigned to the subnet
- enable
Lni NumberAt Device Index - existing
Default BooleanSubnet - id String
- The provider-assigned unique ID for this managed resource.
- ipv6Cidr
Block StringAssociation Id - outpost
Arn String - owner
Id String - Map<String>
- vpc
Id 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) -> DefaultSubnet
func 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)
Resource lookup is not supported in YAML
- 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
- Assign
Ipv6Address boolOn Creation - Availability
Zone string is required
- The
availability_zone_id
,cidr_block
andvpc_id
arguments become computed attributes - The default value for
map_public_ip_on_launch
istrue
This resource supports the following additional arguments:
- The
- Availability
Zone stringId - The AZ ID of the subnet
- Cidr
Block string - The IPv4 CIDR block assigned to the subnet
- Customer
Owned stringIpv4Pool - Enable
Dns64 bool - Enable
Lni intAt Device Index - Enable
Resource boolName Dns ARecord 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
- Ipv6Cidr
Block string - Ipv6Cidr
Block stringAssociation Id - Ipv6Native bool
- Map
Customer boolOwned Ip On Launch - Map
Public boolIp On Launch - Outpost
Arn string - Owner
Id string - Private
Dns stringHostname Type On Launch - Dictionary<string, string>
- Dictionary<string, string>
- Vpc
Id string - The ID of the VPC the subnet is in
- Arn string
- Assign
Ipv6Address boolOn Creation - Availability
Zone string is required
- The
availability_zone_id
,cidr_block
andvpc_id
arguments become computed attributes - The default value for
map_public_ip_on_launch
istrue
This resource supports the following additional arguments:
- The
- Availability
Zone stringId - The AZ ID of the subnet
- Cidr
Block string - The IPv4 CIDR block assigned to the subnet
- Customer
Owned stringIpv4Pool - Enable
Dns64 bool - Enable
Lni intAt Device Index - Enable
Resource boolName Dns ARecord 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
- Ipv6Cidr
Block string - Ipv6Cidr
Block stringAssociation Id - Ipv6Native bool
- Map
Customer boolOwned Ip On Launch - Map
Public boolIp On Launch - Outpost
Arn string - Owner
Id string - Private
Dns stringHostname Type On Launch - map[string]string
- map[string]string
- Vpc
Id string - The ID of the VPC the subnet is in
- arn String
- assign
Ipv6Address BooleanOn Creation - availability
Zone String is required
- The
availability_zone_id
,cidr_block
andvpc_id
arguments become computed attributes - The default value for
map_public_ip_on_launch
istrue
This resource supports the following additional arguments:
- The
- availability
Zone StringId - The AZ ID of the subnet
- cidr
Block String - The IPv4 CIDR block assigned to the subnet
- customer
Owned StringIpv4Pool - enable
Dns64 Boolean - enable
Lni IntegerAt Device Index - enable
Resource BooleanName Dns ARecord On Launch - enable
Resource BooleanName Dns Aaaa Record On Launch - existing
Default BooleanSubnet - force
Destroy Boolean - Whether destroying the resource deletes the default subnet. Default:
false
- ipv6Cidr
Block String - ipv6Cidr
Block StringAssociation Id - ipv6Native Boolean
- map
Customer BooleanOwned Ip On Launch - map
Public BooleanIp On Launch - outpost
Arn String - owner
Id String - private
Dns StringHostname Type On Launch - Map<String,String>
- Map<String,String>
- vpc
Id String - The ID of the VPC the subnet is in
- arn string
- assign
Ipv6Address booleanOn Creation - availability
Zone string is required
- The
availability_zone_id
,cidr_block
andvpc_id
arguments become computed attributes - The default value for
map_public_ip_on_launch
istrue
This resource supports the following additional arguments:
- The
- availability
Zone stringId - The AZ ID of the subnet
- cidr
Block string - The IPv4 CIDR block assigned to the subnet
- customer
Owned stringIpv4Pool - enable
Dns64 boolean - enable
Lni numberAt Device Index - enable
Resource booleanName Dns ARecord On Launch - enable
Resource booleanName Dns Aaaa Record On Launch - existing
Default booleanSubnet - force
Destroy boolean - Whether destroying the resource deletes the default subnet. Default:
false
- ipv6Cidr
Block string - ipv6Cidr
Block stringAssociation Id - ipv6Native boolean
- map
Customer booleanOwned Ip On Launch - map
Public booleanIp On Launch - outpost
Arn string - owner
Id string - private
Dns stringHostname Type On Launch - {[key: string]: string}
- {[key: string]: string}
- vpc
Id 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_block
andvpc_id
arguments become computed attributes - The default value for
map_public_ip_on_launch
istrue
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
- assign
Ipv6Address BooleanOn Creation - availability
Zone String is required
- The
availability_zone_id
,cidr_block
andvpc_id
arguments become computed attributes - The default value for
map_public_ip_on_launch
istrue
This resource supports the following additional arguments:
- The
- availability
Zone StringId - The AZ ID of the subnet
- cidr
Block String - The IPv4 CIDR block assigned to the subnet
- customer
Owned StringIpv4Pool - enable
Dns64 Boolean - enable
Lni NumberAt Device Index - enable
Resource BooleanName Dns ARecord On Launch - enable
Resource BooleanName Dns Aaaa Record On Launch - existing
Default BooleanSubnet - force
Destroy Boolean - Whether destroying the resource deletes the default subnet. Default:
false
- ipv6Cidr
Block String - ipv6Cidr
Block StringAssociation Id - ipv6Native Boolean
- map
Customer BooleanOwned Ip On Launch - map
Public BooleanIp On Launch - outpost
Arn String - owner
Id String - private
Dns StringHostname Type On Launch - Map<String>
- Map<String>
- vpc
Id 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
aws
Terraform Provider.
Try AWS Native preview for resources not in the classic version.