class IpCidr
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.ec2.Alpha.IpCidr |
Go | github.com/aws/aws-cdk-go/awsec2alpha/v2#IpCidr |
Java | software.amazon.awscdk.services.ec2.alpha.IpCidr |
Python | aws_cdk.aws_ec2_alpha.IpCidr |
TypeScript (source) | @aws-cdk/aws-ec2-alpha » IpCidr |
IPv4 or IPv6 CIDR range for the subnet.
Example
const myVpc = new VpcV2(this, 'Vpc');
const routeTable = new RouteTable(this, 'RouteTable', {
vpc: myVpc,
});
const subnet = new SubnetV2(this, 'Subnet', {
vpc: myVpc,
availabilityZone: 'eu-west-2a',
ipv4CidrBlock: new IpCidr('10.0.0.0/24'),
subnetType: SubnetType.PRIVATE_ISOLATED });
const natgw = new NatGateway(this, 'NatGW', {
subnet: subnet,
vpc: myVpc,
connectivityType: NatConnectivityType.PRIVATE,
privateIpAddress: '10.0.0.42',
});
new Route(this, 'NatGwRoute', {
routeTable,
destination: '0.0.0.0/0',
target: { gateway: natgw },
});
Initializer
new IpCidr(props: string)
Parameters
- props
string
Properties
Name | Type | Description |
---|---|---|
cidr | string | IPv6 CIDR range for the subnet Allowed only if IPv6 is enabled on VPc. |
cidr
Type:
string
IPv6 CIDR range for the subnet Allowed only if IPv6 is enabled on VPc.