RequestedSubnet Struct
Subnet requested for allocation.
| Source | aws-ec2/lib/ip-addresses.ts |
|---|---|
| Type last changed |
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 requestedSubnet: ec2.RequestedSubnet = {
availabilityZone: 'availabilityZone',
configuration: {
name: 'name',
subnetType: ec2.SubnetType.PRIVATE_ISOLATED,
// the properties below are optional
cidrMask: 123,
ipv6AssignAddressOnCreation: false,
mapPublicIpOnLaunch: false,
reserved: false,
},
subnetConstructId: 'subnetConstructId',
};
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
requested_subnet = ec2.RequestedSubnet(
availability_zone="availabilityZone",
configuration=ec2.SubnetConfiguration(
name="name",
subnet_type=ec2.SubnetType.PRIVATE_ISOLATED,
# the properties below are optional
cidr_mask=123,
ipv6_assign_address_on_creation=False,
map_public_ip_on_launch=False,
reserved=False
),
subnet_construct_id="subnetConstructId"
)
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.*;
RequestedSubnet requestedSubnet = RequestedSubnet.builder()
.availabilityZone("availabilityZone")
.configuration(SubnetConfiguration.builder()
.name("name")
.subnetType(SubnetType.PRIVATE_ISOLATED)
// the properties below are optional
.cidrMask(123)
.ipv6AssignAddressOnCreation(false)
.mapPublicIpOnLaunch(false)
.reserved(false)
.build())
.subnetConstructId("subnetConstructId")
.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 requestedSubnet = new RequestedSubnet {
AvailabilityZone = "availabilityZone",
Configuration = new SubnetConfiguration {
Name = "name",
SubnetType = SubnetType.PRIVATE_ISOLATED,
// the properties below are optional
CidrMask = 123,
Ipv6AssignAddressOnCreation = false,
MapPublicIpOnLaunch = false,
Reserved = false
},
SubnetConstructId = "subnetConstructId"
};
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"
requestedSubnet := &RequestedSubnet{
AvailabilityZone: jsii.String("availabilityZone"),
Configuration: &SubnetConfiguration{
Name: jsii.String("name"),
SubnetType: awscdk.Aws_ec2.SubnetType_PRIVATE_ISOLATED,
// the properties below are optional
CidrMask: jsii.Number(123),
Ipv6AssignAddressOnCreation: jsii.Boolean(false),
MapPublicIpOnLaunch: jsii.Boolean(false),
Reserved: jsii.Boolean(false),
},
SubnetConstructId: jsii.String("subnetConstructId"),
}
Properties
availabilityZonestringavailability_zonestravailabilityZoneStringAvailabilityZonestringAvailabilityZone*string required #The availability zone for the subnet.
configurationSubnetConfigurationconfigurationSubnetConfigurationconfigurationSubnetConfigurationConfigurationSubnetConfigurationConfigurationSubnetConfiguration required #Specify configuration parameters for a single subnet group in a VPC.
subnetConstructIdstringsubnet_construct_idstrsubnetConstructIdStringSubnetConstructIdstringSubnetConstructId*string required #Id for the Subnet construct.