AllocateCidrRequest Struct
Request for subnets CIDR to be allocated for a Vpc.
| 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 allocateCidrRequest: ec2.AllocateCidrRequest = {
requestedSubnets: [{
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',
}],
vpcCidr: 'vpcCidr',
};
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
allocate_cidr_request = ec2.AllocateCidrRequest(
requested_subnets=[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"
)],
vpc_cidr="vpcCidr"
)
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.*;
AllocateCidrRequest allocateCidrRequest = AllocateCidrRequest.builder()
.requestedSubnets(List.of(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()))
.vpcCidr("vpcCidr")
.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 allocateCidrRequest = new AllocateCidrRequest {
RequestedSubnets = new [] { 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"
} },
VpcCidr = "vpcCidr"
};
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"
allocateCidrRequest := &AllocateCidrRequest{
RequestedSubnets: []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"),
},
},
VpcCidr: jsii.String("vpcCidr"),
}
Properties
requestedSubnetsRequestedSubnet[]requested_subnetstyping.List[RequestedSubnet]requestedSubnetsList<RequestedSubnet>RequestedSubnetsRequestedSubnet[]RequestedSubnets*[]RequestedSubnet required #The Subnets to be allocated.
The IPv4 CIDR block for this Vpc.