Expand description
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
resources:
defaultAz1:
type: aws:ec2:DefaultSubnet
name: default_az1
properties:
availabilityZone: us-west-2a
tags:
Name: Default subnet for us-west-2a
§Import
Using pulumi import
, import subnets using the subnet id
. For example:
$ pulumi import aws:ec2/defaultSubnet:DefaultSubnet public_subnet subnet-9d4a7b6c
Structs§
- Use builder syntax to set the inputs and finish with
build_struct()
.
Functions§
- Registers a new resource with the given unique name and arguments