aws-cdk-lib.aws_rds.SubnetGroupProps

interface SubnetGroupProps

LanguageType name
.NETAmazon.CDK.AWS.RDS.SubnetGroupProps
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsrds#SubnetGroupProps
Javasoftware.amazon.awscdk.services.rds.SubnetGroupProps
Pythonaws_cdk.aws_rds.SubnetGroupProps
TypeScript (source)aws-cdk-lib » aws_rds » SubnetGroupProps

Properties for creating a SubnetGroup.

Example

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

NameTypeDescription
descriptionstringDescription of the subnet group.
vpcIVpcThe VPC to place the subnet group in.
removalPolicy?RemovalPolicyThe removal policy to apply when the subnet group are removed from the stack or replaced during an update.
subnetGroupName?stringThe name of the subnet group.
vpcSubnets?SubnetSelectionWhich subnets within the VPC to associate with this group.

description

Type: string

Description of the subnet group.


vpc

Type: IVpc

The VPC to place the subnet group in.


removalPolicy?

Type: RemovalPolicy (optional, default: RemovalPolicy.DESTROY)

The removal policy to apply when the subnet group are removed from the stack or replaced during an update.


subnetGroupName?

Type: string (optional, default: a name is generated)

The name of the subnet group.


vpcSubnets?

Type: SubnetSelection (optional, default: private subnets)

Which subnets within the VPC to associate with this group.