Class PrivateSubnet
Represents a private VPC subnet resource.
Inherited Members
Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class PrivateSubnet : Subnet, IPrivateSubnet, ISubnet, IResource, ISubnetRef, IConstruct, IDependable, IEnvironmentAware
Syntax (vb)
Public Class PrivateSubnet Inherits Subnet Implements IPrivateSubnet, 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 privateSubnet = new PrivateSubnet(this, "MyPrivateSubnet", new PrivateSubnetProps {
AvailabilityZone = "availabilityZone",
CidrBlock = "cidrBlock",
VpcId = "vpcId",
// the properties below are optional
AssignIpv6AddressOnCreation = false,
Ipv6CidrBlock = "ipv6CidrBlock",
MapPublicIpOnLaunch = false
});
Synopsis
Constructors
| PrivateSubnet(Construct, string, IPrivateSubnetProps) | Represents a private VPC subnet resource. |
Properties
| PROPERTY_INJECTION_ID | Uniquely identifies this class. |
Methods
| FromPrivateSubnetAttributes(Construct, string, IPrivateSubnetAttributes) | Represents a private VPC subnet resource. |
Constructors
PrivateSubnet(Construct, string, IPrivateSubnetProps)
Represents a private VPC subnet resource.
public PrivateSubnet(Construct scope, string id, IPrivateSubnetProps props)
Parameters
- scope Construct
- id string
- props IPrivateSubnetProps
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 privateSubnet = new PrivateSubnet(this, "MyPrivateSubnet", new PrivateSubnetProps {
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
Remarks
ExampleMetadata: fixture=_generated
Methods
FromPrivateSubnetAttributes(Construct, string, IPrivateSubnetAttributes)
Represents a private VPC subnet resource.
public static IPrivateSubnet FromPrivateSubnetAttributes(Construct scope, string id, IPrivateSubnetAttributes attrs)
Parameters
- scope Construct
- id string
- attrs IPrivateSubnetAttributes
Returns
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 privateSubnet = new PrivateSubnet(this, "MyPrivateSubnet", new PrivateSubnetProps {
AvailabilityZone = "availabilityZone",
CidrBlock = "cidrBlock",
VpcId = "vpcId",
// the properties below are optional
AssignIpv6AddressOnCreation = false,
Ipv6CidrBlock = "ipv6CidrBlock",
MapPublicIpOnLaunch = false
});
Implements
Constructs.IConstruct
Constructs.IDependable