# VpcSubnetGroup

A group of subnets returned by the VPC provider.

The included subnets do NOT have to be symmetric!

- Source: [`cx-api/lib/legacy-moved.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/cx-api/lib/legacy-moved.ts#L881)
- Type last changed: v2.238.0 · 9 Feb 2026

## Example

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { cx_api } from 'aws-cdk-lib';
const vpcSubnetGroup: cx_api.VpcSubnetGroup = {
  name: 'name',
  subnets: [{
    availabilityZone: 'availabilityZone',
    routeTableId: 'routeTableId',
    subnetId: 'subnetId',

    // the properties below are optional
    cidr: 'cidr',
  }],
  type: cx_api.VpcSubnetGroupType.PUBLIC,
};
```

## Properties

- `name`: string (required) — The name of the subnet group, determined by looking at the tags of of the subnets that belong to it.

- `subnets`: [VpcSubnet](/cdk/api/v2/docs/aws-cdk-lib.cx_api.VpcSubnet.html)[] (required) — The subnets that are part of this group.

  There is no condition that the subnets have to be symmetric
  in the group.

- `type`: [VpcSubnetGroupType](/cdk/api/v2/docs/aws-cdk-lib.cx_api.VpcSubnetGroupType.html) (required) — The type of the subnet group.
