DefaultSubnet

Provides a resource to manage a default AWS VPC subnet in the current region.

The aws.ec2.DefaultSubnet behaves differently from normal resources, in that this provider does not create this resource, but instead “adopts” it into management.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var defaultAz1 = new Aws.Ec2.DefaultSubnet("defaultAz1", new Aws.Ec2.DefaultSubnetArgs
        {
            AvailabilityZone = "us-west-2a",
            Tags = 
            {
                { "Name", "Default subnet for us-west-2a" },
            },
        });
    }

}
package main

import (
    "github.com/pulumi/pulumi-aws/sdk/v2/go/aws/ec2"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        _, err := ec2.NewDefaultSubnet(ctx, "defaultAz1", &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
    })
}
import pulumi
import pulumi_aws as aws

default_az1 = aws.ec2.DefaultSubnet("defaultAz1",
    availability_zone="us-west-2a",
    tags={
        "Name": "Default subnet for us-west-2a",
    })
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",
    },
});

Create a DefaultSubnet Resource

def DefaultSubnet(resource_name, opts=None, availability_zone=None, map_public_ip_on_launch=None, outpost_arn=None, tags=None, __props__=None);
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.
opts ResourceOptions
A bag of options that control this 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.

DefaultSubnet Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The DefaultSubnet resource accepts the following input properties:

AvailabilityZone string
MapPublicIpOnLaunch bool

Specify true to indicate that instances launched into the subnet should be assigned a public IP address.

OutpostArn string
Tags Dictionary<string, string>

A map of tags to assign to the resource.

AvailabilityZone string
MapPublicIpOnLaunch bool

Specify true to indicate that instances launched into the subnet should be assigned a public IP address.

OutpostArn string
Tags map[string]string

A map of tags to assign to the resource.

availabilityZone string
mapPublicIpOnLaunch boolean

Specify true to indicate that instances launched into the subnet should be assigned a public IP address.

outpostArn string
tags {[key: string]: string}

A map of tags to assign to the resource.

availability_zone str
map_public_ip_on_launch bool

Specify true to indicate that instances launched into the subnet should be assigned a public IP address.

outpost_arn str
tags Dict[str, str]

A map of tags to assign to the resource.

Outputs

All input properties are implicitly available as output properties. Additionally, the DefaultSubnet resource produces the following output properties:

Arn string
AssignIpv6AddressOnCreation bool
AvailabilityZoneId string
CidrBlock string

The CIDR block for the subnet.

Id string
The provider-assigned unique ID for this managed resource.
Ipv6CidrBlock string

The IPv6 CIDR block.

Ipv6CidrBlockAssociationId string
OwnerId string

The ID of the AWS account that owns the subnet.

VpcId string

The VPC ID.

Arn string
AssignIpv6AddressOnCreation bool
AvailabilityZoneId string
CidrBlock string

The CIDR block for the subnet.

Id string
The provider-assigned unique ID for this managed resource.
Ipv6CidrBlock string

The IPv6 CIDR block.

Ipv6CidrBlockAssociationId string
OwnerId string

The ID of the AWS account that owns the subnet.

VpcId string

The VPC ID.

arn string
assignIpv6AddressOnCreation boolean
availabilityZoneId string
cidrBlock string

The CIDR block for the subnet.

id string
The provider-assigned unique ID for this managed resource.
ipv6CidrBlock string

The IPv6 CIDR block.

ipv6CidrBlockAssociationId string
ownerId string

The ID of the AWS account that owns the subnet.

vpcId string

The VPC ID.

arn str
assign_ipv6_address_on_creation bool
availability_zone_id str
cidr_block str

The CIDR block for the subnet.

id str
The provider-assigned unique ID for this managed resource.
ipv6_cidr_block str

The IPv6 CIDR block.

ipv6_cidr_block_association_id str
owner_id str

The ID of the AWS account that owns the subnet.

vpc_id str

The VPC ID.

Look up an 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
static get(resource_name, id, opts=None, arn=None, assign_ipv6_address_on_creation=None, availability_zone=None, availability_zone_id=None, cidr_block=None, ipv6_cidr_block=None, ipv6_cidr_block_association_id=None, map_public_ip_on_launch=None, outpost_arn=None, owner_id=None, tags=None, vpc_id=None, __props__=None);
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)
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.

The following state arguments are supported:

Arn string
AssignIpv6AddressOnCreation bool
AvailabilityZone string
AvailabilityZoneId string
CidrBlock string

The CIDR block for the subnet.

Ipv6CidrBlock string

The IPv6 CIDR block.

Ipv6CidrBlockAssociationId string
MapPublicIpOnLaunch bool

Specify true to indicate that instances launched into the subnet should be assigned a public IP address.

OutpostArn string
OwnerId string

The ID of the AWS account that owns the subnet.

Tags Dictionary<string, string>

A map of tags to assign to the resource.

VpcId string

The VPC ID.

Arn string
AssignIpv6AddressOnCreation bool
AvailabilityZone string
AvailabilityZoneId string
CidrBlock string

The CIDR block for the subnet.

Ipv6CidrBlock string

The IPv6 CIDR block.

Ipv6CidrBlockAssociationId string
MapPublicIpOnLaunch bool

Specify true to indicate that instances launched into the subnet should be assigned a public IP address.

OutpostArn string
OwnerId string

The ID of the AWS account that owns the subnet.

Tags map[string]string

A map of tags to assign to the resource.

VpcId string

The VPC ID.

arn string
assignIpv6AddressOnCreation boolean
availabilityZone string
availabilityZoneId string
cidrBlock string

The CIDR block for the subnet.

ipv6CidrBlock string

The IPv6 CIDR block.

ipv6CidrBlockAssociationId string
mapPublicIpOnLaunch boolean

Specify true to indicate that instances launched into the subnet should be assigned a public IP address.

outpostArn string
ownerId string

The ID of the AWS account that owns the subnet.

tags {[key: string]: string}

A map of tags to assign to the resource.

vpcId string

The VPC ID.

arn str
assign_ipv6_address_on_creation bool
availability_zone str
availability_zone_id str
cidr_block str

The CIDR block for the subnet.

ipv6_cidr_block str

The IPv6 CIDR block.

ipv6_cidr_block_association_id str
map_public_ip_on_launch bool

Specify true to indicate that instances launched into the subnet should be assigned a public IP address.

outpost_arn str
owner_id str

The ID of the AWS account that owns the subnet.

tags Dict[str, str]

A map of tags to assign to the resource.

vpc_id str

The VPC ID.

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.