# AwsIpamProps

Configuration for AwsIpam.

Used as argument in: [IpAddresses.awsIpamAllocation](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.IpAddresses.html#awsipamallocation)

- Source: [`aws-ec2/lib/ip-addresses.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-ec2/lib/ip-addresses.ts#L228)
- Type last changed: v2.48.0 · 27 Oct 2022

## Example

TypeScript:

```ts
import { IpAddresses } from 'aws-cdk-lib/aws-ec2';

declare const pool: ec2.CfnIPAMPool;

new ec2.Vpc(this, 'TheVPC', {
  ipAddresses: IpAddresses.awsIpamAllocation({
    ipv4IpamPoolId: pool.ref,
    ipv4NetmaskLength: 18,
    defaultSubnetIpv4NetmaskLength: 24
  })
});
```

Python:

```python
from aws_cdk.aws_ec2 import IpAddresses

# pool: ec2.CfnIPAMPool

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

Java:

```java
import software.amazon.awscdk.services.ec2.IpAddresses;

CfnIPAMPool pool;

Vpc.Builder.create(this, "TheVPC")
        .ipAddresses(IpAddresses.awsIpamAllocation(AwsIpamProps.builder()
                .ipv4IpamPoolId(pool.getRef())
                .ipv4NetmaskLength(18)
                .defaultSubnetIpv4NetmaskLength(24)
                .build()))
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
using Amazon.CDK.AWS.EC2;

CfnIPAMPool pool;

new Vpc(this, "TheVPC", new VpcProps {
    IpAddresses = IpAddresses.AwsIpamAllocation(new AwsIpamProps {
        Ipv4IpamPoolId = pool.Ref,
        Ipv4NetmaskLength = 18,
        DefaultSubnetIpv4NetmaskLength = 24
    })
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
import "github.com/aws/aws-cdk-go/awscdk"

var pool CfnIPAMPool

ec2.NewVpc(this, jsii.String("TheVPC"), &VpcProps{
	IpAddresses: awscdk.IpAddresses_AwsIpamAllocation(&AwsIpamProps{
		Ipv4IpamPoolId: pool.ref,
		Ipv4NetmaskLength: jsii.Number(18),
		DefaultSubnetIpv4NetmaskLength: jsii.Number(24),
	}),
})
```

## Properties

- `defaultSubnetIpv4NetmaskLength`: number — Default length for Subnet ipv4 Network mask.

  **Default:** Default ipv4 Subnet Mask for subnets in Vpc

  Specify this option only if you do not specify all Subnets using SubnetConfiguration with a cidrMask

- `ipv4IpamPoolId`: string (required) — Ipam Pool Id for ipv4 allocation.

- `ipv4NetmaskLength`: number (required) — Netmask length for Vpc.
