# SubnetIpamOptions

CIDR Allocated Subnets.

Returned by: [IIpAddresses.allocateSubnetsCidr](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.IIpAddresses.html#allocatesubnetscidr), IIpv6Addresses.allocateSubnetsIpv6Cidr

- 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#L197)
- Type last changed: v2.48.0 · 27 Oct 2022

## Example

TypeScript:

```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 subnetIpamOptions: ec2.SubnetIpamOptions = {
  allocatedSubnets: [{
    cidr: 'cidr',

    // the properties below are optional
    ipv6Cidr: 'ipv6Cidr',
  }],
};
```

Python:

```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

subnet_ipam_options = ec2.SubnetIpamOptions(
    allocated_subnets=[ec2.AllocatedSubnet(
        cidr="cidr",

        # the properties below are optional
        ipv6_cidr="ipv6Cidr"
    )]
)
```

Java:

```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.*;

SubnetIpamOptions subnetIpamOptions = SubnetIpamOptions.builder()
        .allocatedSubnets(List.of(AllocatedSubnet.builder()
                .cidr("cidr")

                // the properties below are optional
                .ipv6Cidr("ipv6Cidr")
                .build()))
        .build();
```

C# / .NET:

```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 subnetIpamOptions = new SubnetIpamOptions {
    AllocatedSubnets = new [] { new AllocatedSubnet {
        Cidr = "cidr",

        // the properties below are optional
        Ipv6Cidr = "ipv6Cidr"
    } }
};
```

Golang:

```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"

subnetIpamOptions := &SubnetIpamOptions{
	AllocatedSubnets: []AllocatedSubnet{
		&AllocatedSubnet{
			Cidr: jsii.String("cidr"),

			// the properties below are optional
			Ipv6Cidr: jsii.String("ipv6Cidr"),
		},
	},
}
```

## Properties

- `allocatedSubnets`: [AllocatedSubnet](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.AllocatedSubnet.html)[] (required) — CIDR Allocations for Subnets.
