Show / Hide Table of Contents

Class PublicSubnet

Represents a public VPC subnet resource.

Inheritance
object
Resource
Subnet
PublicSubnet
Implements
IPublicSubnet
ISubnet
IResource
ISubnetRef
IConstruct
IDependable
IEnvironmentAware
Inherited Members
Subnet.FromSubnetAttributes(Construct, string, ISubnetAttributes)
Subnet.FromSubnetId(Construct, string, string)
Subnet.IsVpcSubnet(object)
Subnet.AddDefaultInternetRoute(string, IDependable)
Subnet.AddDefaultNatRoute(string)
Subnet.AddIpv6DefaultEgressOnlyInternetRoute(string)
Subnet.AddIpv6DefaultInternetRoute(string)
Subnet.AddIpv6Nat64Route(string)
Subnet.AddRoute(string, IAddRouteOptions)
Subnet.AssociateNetworkAcl(string, INetworkAcl)
Subnet.AvailabilityZone
Subnet.DependencyElements
Subnet.InternetConnectivityEstablished
Subnet.Ipv4CidrBlock
Subnet.NetworkAcl
Subnet.RouteTable
Subnet.SubnetAvailabilityZone
Subnet.SubnetId
Subnet.SubnetIpv6CidrBlocks
Subnet.SubnetNetworkAclAssociationId
Subnet.SubnetOutpostArn
Subnet.SubnetRef
Subnet.SubnetVpcId
Resource.IsOwnedResource(IConstruct)
Resource.IsResource(IConstruct)
Resource.ApplyRemovalPolicy(RemovalPolicy)
Resource.GeneratePhysicalName()
Resource.GetResourceArnAttribute(string, IArnComponents)
Resource.GetResourceNameAttribute(string)
Resource.Env
Resource.PhysicalName
Resource.Stack
Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class PublicSubnet : Subnet, IPublicSubnet, ISubnet, IResource, ISubnetRef, IConstruct, IDependable, IEnvironmentAware
Syntax (vb)
Public Class PublicSubnet Inherits Subnet Implements IPublicSubnet, ISubnet, IResource, ISubnetRef, IConstruct, IDependable, IEnvironmentAware
Remarks

ExampleMetadata: fixture=_generated

Examples
// The code below shows an example of how to instantiate this type.
            // The values are placeholders you should change.
            using Amazon.CDK.AWS.EC2;

            var publicSubnet = new PublicSubnet(this, "MyPublicSubnet", new PublicSubnetProps {
                AvailabilityZone = "availabilityZone",
                CidrBlock = "cidrBlock",
                VpcId = "vpcId",

                // the properties below are optional
                AssignIpv6AddressOnCreation = false,
                Ipv6CidrBlock = "ipv6CidrBlock",
                MapPublicIpOnLaunch = false
            });

Synopsis

Constructors

PublicSubnet(Construct, string, IPublicSubnetProps)

Represents a public VPC subnet resource.

Properties

PROPERTY_INJECTION_ID

Uniquely identifies this class.

Methods

AddNatGateway(string?)

Creates a new managed NAT gateway attached to this public subnet.

FromPublicSubnetAttributes(Construct, string, IPublicSubnetAttributes)

Represents a public VPC subnet resource.

Constructors

PublicSubnet(Construct, string, IPublicSubnetProps)

Represents a public VPC subnet resource.

public PublicSubnet(Construct scope, string id, IPublicSubnetProps props)
Parameters
scope Construct
id string
props IPublicSubnetProps
Remarks

ExampleMetadata: fixture=_generated

Examples
// The code below shows an example of how to instantiate this type.
            // The values are placeholders you should change.
            using Amazon.CDK.AWS.EC2;

            var publicSubnet = new PublicSubnet(this, "MyPublicSubnet", new PublicSubnetProps {
                AvailabilityZone = "availabilityZone",
                CidrBlock = "cidrBlock",
                VpcId = "vpcId",

                // the properties below are optional
                AssignIpv6AddressOnCreation = false,
                Ipv6CidrBlock = "ipv6CidrBlock",
                MapPublicIpOnLaunch = false
            });

Properties

PROPERTY_INJECTION_ID

Uniquely identifies this class.

public static string PROPERTY_INJECTION_ID { get; }
Property Value

string

Remarks

ExampleMetadata: fixture=_generated

Methods

AddNatGateway(string?)

Creates a new managed NAT gateway attached to this public subnet.

public virtual CfnNatGateway AddNatGateway(string? eipAllocationId = null)
Parameters
eipAllocationId string
Returns

CfnNatGateway

A ref to the the NAT Gateway ID

Remarks

Also adds the EIP for the managed NAT.

FromPublicSubnetAttributes(Construct, string, IPublicSubnetAttributes)

Represents a public VPC subnet resource.

public static IPublicSubnet FromPublicSubnetAttributes(Construct scope, string id, IPublicSubnetAttributes attrs)
Parameters
scope Construct
id string
attrs IPublicSubnetAttributes
Returns

IPublicSubnet

Remarks

ExampleMetadata: fixture=_generated

Examples
// The code below shows an example of how to instantiate this type.
            // The values are placeholders you should change.
            using Amazon.CDK.AWS.EC2;

            var publicSubnet = new PublicSubnet(this, "MyPublicSubnet", new PublicSubnetProps {
                AvailabilityZone = "availabilityZone",
                CidrBlock = "cidrBlock",
                VpcId = "vpcId",

                // the properties below are optional
                AssignIpv6AddressOnCreation = false,
                Ipv6CidrBlock = "ipv6CidrBlock",
                MapPublicIpOnLaunch = false
            });

Implements

IPublicSubnet
ISubnet
IResource
ISubnetRef
Constructs.IConstruct
Constructs.IDependable
IEnvironmentAware
Back to top Generated by DocFX