IpAddresses

class aws_cdk.aws_ec2.IpAddresses(*args: Any, **kwargs)

Bases: object

An abstract Provider of IpAddresses.

ExampleMetadata

infused

Example:

# Example automatically generated from non-compiling source. May contain errors.
from aws_cdk.aws_ec2 import IpAddresses

# pool: ec2.CfnIPAMPool


ec2.Vpc(stack, "TheVPC",
    ip_addresses=ec2.IpAddresses.aws_ipam_allocation(
        ipv4_ipam_pool_id=pool.ref,
        ipv4_netmask_length=18,
        default_subnet_ipv4_netmask_length=24
    )
)

Static Methods

classmethod aws_ipam_allocation(*, ipv4_ipam_pool_id, ipv4_netmask_length, default_subnet_ipv4_netmask_length=None)

Used to provide centralized Ip Address Management services for your VPC.

Uses VPC Cidr allocations from AWS IPAM

Parameters
  • ipv4_ipam_pool_id (str) – Ipam Pool Id for ipv4 allocation.

  • ipv4_netmask_length (Union[int, float]) – Netmask length for Vpc.

  • default_subnet_ipv4_netmask_length (Union[int, float, None]) – Default length for Subnet ipv4 Network mask. Specify this option only if you do not specify all Subnets using SubnetConfiguration with a cidrMask Default: - Default ipv4 Subnet Mask for subnets in Vpc

See

https://docs.aws.amazon.com/vpc/latest/ipam/what-it-is-ipam.html

Return type

IIpAddresses

classmethod cidr(cidr_block)

Used to provide local Ip Address Management services for your VPC.

VPC Cidr is supplied at creation and subnets are calculated locally

Parameters

cidr_block (str) –

Return type

IIpAddresses