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
new DefaultSubnet(name: string, args: DefaultSubnetArgs, opts?: CustomResourceOptions);def DefaultSubnet(resource_name, opts=None, availability_zone=None, map_public_ip_on_launch=None, outpost_arn=None, tags=None, __props__=None);func NewDefaultSubnet(ctx *Context, name string, args DefaultSubnetArgs, opts ...ResourceOption) (*DefaultSubnet, error)public DefaultSubnet(string name, DefaultSubnetArgs args, CustomResourceOptions? opts = null)- 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:
- Availability
Zone string - Map
Public boolIp On Launch Specify true to indicate that instances launched into the subnet should be assigned a public IP address.
- Outpost
Arn string - Dictionary<string, string>
A map of tags to assign to the resource.
- Availability
Zone string - Map
Public boolIp On Launch Specify true to indicate that instances launched into the subnet should be assigned a public IP address.
- Outpost
Arn string - map[string]string
A map of tags to assign to the resource.
- availability
Zone string - map
Public booleanIp On Launch Specify true to indicate that instances launched into the subnet should be assigned a public IP address.
- outpost
Arn string - {[key: string]: string}
A map of tags to assign to the resource.
- availability_
zone str - map_
public_ boolip_ on_ launch Specify true to indicate that instances launched into the subnet should be assigned a public IP address.
- outpost_
arn str - 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
- Assign
Ipv6Address boolOn Creation - Availability
Zone stringId - Cidr
Block string The CIDR block for the subnet.
- Id string
- The provider-assigned unique ID for this managed resource.
- Ipv6Cidr
Block string The IPv6 CIDR block.
- Ipv6Cidr
Block stringAssociation Id - Owner
Id string The ID of the AWS account that owns the subnet.
- Vpc
Id string The VPC ID.
- Arn string
- Assign
Ipv6Address boolOn Creation - Availability
Zone stringId - Cidr
Block string The CIDR block for the subnet.
- Id string
- The provider-assigned unique ID for this managed resource.
- Ipv6Cidr
Block string The IPv6 CIDR block.
- Ipv6Cidr
Block stringAssociation Id - Owner
Id string The ID of the AWS account that owns the subnet.
- Vpc
Id string The VPC ID.
- arn string
- assign
Ipv6Address booleanOn Creation - availability
Zone stringId - cidr
Block string The CIDR block for the subnet.
- id string
- The provider-assigned unique ID for this managed resource.
- ipv6Cidr
Block string The IPv6 CIDR block.
- ipv6Cidr
Block stringAssociation Id - owner
Id string The ID of the AWS account that owns the subnet.
- vpc
Id string The VPC ID.
- arn str
- assign_
ipv6_ booladdress_ on_ creation - availability_
zone_ strid - cidr_
block str The CIDR block for the subnet.
- id str
- The provider-assigned unique ID for this managed resource.
- ipv6_
cidr_ strblock The IPv6 CIDR block.
- ipv6_
cidr_ strblock_ association_ id - 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): DefaultSubnetstatic 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
- Assign
Ipv6Address boolOn Creation - Availability
Zone string - Availability
Zone stringId - Cidr
Block string The CIDR block for the subnet.
- Ipv6Cidr
Block string The IPv6 CIDR block.
- Ipv6Cidr
Block stringAssociation Id - Map
Public boolIp On Launch Specify true to indicate that instances launched into the subnet should be assigned a public IP address.
- Outpost
Arn string - Owner
Id string The ID of the AWS account that owns the subnet.
- Dictionary<string, string>
A map of tags to assign to the resource.
- Vpc
Id string The VPC ID.
- Arn string
- Assign
Ipv6Address boolOn Creation - Availability
Zone string - Availability
Zone stringId - Cidr
Block string The CIDR block for the subnet.
- Ipv6Cidr
Block string The IPv6 CIDR block.
- Ipv6Cidr
Block stringAssociation Id - Map
Public boolIp On Launch Specify true to indicate that instances launched into the subnet should be assigned a public IP address.
- Outpost
Arn string - Owner
Id string The ID of the AWS account that owns the subnet.
- map[string]string
A map of tags to assign to the resource.
- Vpc
Id string The VPC ID.
- arn string
- assign
Ipv6Address booleanOn Creation - availability
Zone string - availability
Zone stringId - cidr
Block string The CIDR block for the subnet.
- ipv6Cidr
Block string The IPv6 CIDR block.
- ipv6Cidr
Block stringAssociation Id - map
Public booleanIp On Launch Specify true to indicate that instances launched into the subnet should be assigned a public IP address.
- outpost
Arn string - owner
Id string The ID of the AWS account that owns the subnet.
- {[key: string]: string}
A map of tags to assign to the resource.
- vpc
Id string The VPC ID.
- arn str
- assign_
ipv6_ booladdress_ on_ creation - availability_
zone str - availability_
zone_ strid - cidr_
block str The CIDR block for the subnet.
- ipv6_
cidr_ strblock The IPv6 CIDR block.
- ipv6_
cidr_ strblock_ association_ id - map_
public_ boolip_ on_ launch 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.
- 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
awsTerraform Provider.