Skip to content
v2.277.0

PrivateSubnetAttributes Struct ​

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_ec2 as ec2 } from 'aws-cdk-lib';
const privateSubnetAttributes: ec2.PrivateSubnetAttributes = {
  subnetId: 'subnetId',

  // the properties below are optional
  availabilityZone: 'availabilityZone',
  ipv4CidrBlock: 'ipv4CidrBlock',
  routeTableId: 'routeTableId',
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_ec2 as ec2

private_subnet_attributes = ec2.PrivateSubnetAttributes(
    subnet_id="subnetId",

    # the properties below are optional
    availability_zone="availabilityZone",
    ipv4_cidr_block="ipv4CidrBlock",
    route_table_id="routeTableId"
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.ec2.*;

PrivateSubnetAttributes privateSubnetAttributes = PrivateSubnetAttributes.builder()
        .subnetId("subnetId")

        // the properties below are optional
        .availabilityZone("availabilityZone")
        .ipv4CidrBlock("ipv4CidrBlock")
        .routeTableId("routeTableId")
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// 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 privateSubnetAttributes = new PrivateSubnetAttributes {
    SubnetId = "subnetId",

    // the properties below are optional
    AvailabilityZone = "availabilityZone",
    Ipv4CidrBlock = "ipv4CidrBlock",
    RouteTableId = "routeTableId"
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

privateSubnetAttributes := &PrivateSubnetAttributes{
	SubnetId: jsii.String("subnetId"),

	// the properties below are optional
	AvailabilityZone: jsii.String("availabilityZone"),
	Ipv4CidrBlock: jsii.String("ipv4CidrBlock"),
	RouteTableId: jsii.String("routeTableId"),
}

Properties ​

availabilityZoneoptionalstringavailability_zoneoptionalstravailabilityZoneoptionalStringAvailabilityZoneoptionalstringAvailabilityZoneoptional*string#
The Availability Zone the subnet is located in.

Default: No AZ information, cannot use AZ selection features

ipv4CidrBlockoptionalstringipv4_cidr_blockoptionalstripv4CidrBlockoptionalStringIpv4CidrBlockoptionalstringIpv4CidrBlockoptional*string#
The IPv4 CIDR block associated with the subnet.

Default: No CIDR information, cannot use CIDR filter features

routeTableIdoptionalstringroute_table_idoptionalstrrouteTableIdoptionalStringRouteTableIdoptionalstringRouteTableIdoptional*string#
The ID of the route table for this particular subnet.

Default: No route table information, cannot create VPC endpoints

subnetIdstringsubnet_idstrsubnetIdStringSubnetIdstringSubnetId*stringrequired#
The subnetId for this particular subnet.