Class PublicSubnet
Represents a public VPC subnet resource.
Inherited Members
Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class PublicSubnet : Subnet, IPublicSubnet, ISubnet, IResource
Syntax (vb)
Public Class PublicSubnet
Inherits Subnet
Implements IPublicSubnet, ISubnet, IResource
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(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
PublicSubnet(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
PublicSubnet(Construct, String, IPublicSubnetProps) |
Methods
AddNatGateway(String) | Creates a new managed NAT gateway attached to this public subnet. |
FromPublicSubnetAttributes(Construct, String, IPublicSubnetAttributes) |
Constructors
PublicSubnet(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected PublicSubnet(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
PublicSubnet(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected PublicSubnet(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
PublicSubnet(Construct, String, IPublicSubnetProps)
public PublicSubnet(Construct scope, string id, IPublicSubnetProps props)
Parameters
- scope Constructs.Construct
- id System.String
- props IPublicSubnetProps
Methods
AddNatGateway(String)
Creates a new managed NAT gateway attached to this public subnet.
public virtual CfnNatGateway AddNatGateway(string eipAllocationId = null)
Parameters
- eipAllocationId System.String
Returns
A ref to the the NAT Gateway ID
Remarks
Also adds the EIP for the managed NAT.
FromPublicSubnetAttributes(Construct, String, IPublicSubnetAttributes)
public static IPublicSubnet FromPublicSubnetAttributes(Construct scope, string id, IPublicSubnetAttributes attrs)
Parameters
- scope Constructs.Construct
- id System.String
- attrs IPublicSubnetAttributes
Returns
Implements
Constructs.IConstruct
Constructs.IDependable