# SubnetGroupProps

Properties for creating a SubnetGroup.

Extends: SubnetGroupProps
Used as props by: SubnetGroup

- Source: [`aws-rds/lib/subnet-group.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-rds/lib/subnet-group.ts#L24)

## Example

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
import { aws_ec2 as ec2 } from 'aws-cdk-lib';
import { aws_rds as rds } from 'aws-cdk-lib';

declare const subnet: ec2.Subnet;
declare const subnetFilter: ec2.SubnetFilter;
declare const vpc: ec2.Vpc;
const subnetGroupProps: rds.SubnetGroupProps = {
  description: 'description',
  vpc: vpc,

  // the properties below are optional
  removalPolicy: cdk.RemovalPolicy.DESTROY,
  subnetGroupName: 'subnetGroupName',
  vpcSubnets: {
    availabilityZones: ['availabilityZones'],
    onePerAz: false,
    subnetFilters: [subnetFilter],
    subnetGroupName: 'subnetGroupName',
    subnets: [subnet],
    subnetType: ec2.SubnetType.PRIVATE_ISOLATED,
  },
};
```

## Properties

- `description`: string (required) — Description of the subnet group.

- `removalPolicy`: [RemovalPolicy](/cdk/api/v2/docs/aws-cdk-lib.RemovalPolicy.html) = RemovalPolicy.DESTROY — The removal policy to apply when the subnet group are removed from the stack or replaced during an update.

- `subnetGroupName`: string — The name of the subnet group.

  **Default:** a name is generated

- `vpc`: [IVpc](/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.IVpc.html) (required) — The VPC to place the subnet group in.

- `vpcSubnets`: [SubnetSelection](/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.SubnetSelection.html) — Which subnets within the VPC to associate with this group.

  **Default:** private subnets
