@aws-cdk_aws-neptune-alpha.SubnetGroup

class SubnetGroup (construct) ๐Ÿ”น

LanguageType name
.NETAmazon.CDK.AWS.Neptune.Alpha.SubnetGroup
Gogithub.com/aws/aws-cdk-go/awscdkneptunealpha/v2#SubnetGroup
Javasoftware.amazon.awscdk.services.neptune.alpha.SubnetGroup
Pythonaws_cdk.aws_neptune_alpha.SubnetGroup
TypeScript (source)@aws-cdk/aws-neptune-alpha ยป SubnetGroup

Implements IConstruct, IDependable, IResource, ISubnetGroup

Class for creating a RDS DB subnet group.

Example

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

declare const subnet: ec2.Subnet;
declare const subnetFilter: ec2.SubnetFilter;
declare const vpc: ec2.Vpc;
const subnetGroup = new neptune_alpha.SubnetGroup(this, 'MySubnetGroup', {
  vpc: vpc,

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

Initializer

new SubnetGroup(scope: Construct, id: string, props: SubnetGroupProps)

Parameters

  • scope Construct
  • id string
  • props SubnetGroupProps

Construct Props

NameTypeDescription
vpc๐Ÿ”นIVpcThe VPC to place the subnet group in.
description?๐Ÿ”นstringDescription of the subnet group.
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.

vpc๐Ÿ”น

Type: IVpc

The VPC to place the subnet group in.


description?๐Ÿ”น

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

Description of the subnet group.


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.

Properties

NameTypeDescription
env๐Ÿ”นResourceEnvironmentThe environment this resource belongs to.
node๐Ÿ”นNodeThe tree node.
stack๐Ÿ”นStackThe stack in which this resource is defined.
subnetGroupName๐Ÿ”นstringThe name of the subnet group.

env๐Ÿ”น

Type: ResourceEnvironment

The environment this resource belongs to.

For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.


node๐Ÿ”น

Type: Node

The tree node.


stack๐Ÿ”น

Type: Stack

The stack in which this resource is defined.


subnetGroupName๐Ÿ”น

Type: string

The name of the subnet group.

Methods

NameDescription
applyRemovalPolicy(policy)๐Ÿ”นApply the given removal policy to this resource.
toString()๐Ÿ”นReturns a string representation of this construct.
static fromSubnetGroupName(scope, id, subnetGroupName)๐Ÿ”นImports an existing subnet group by name.

applyRemovalPolicy(policy)๐Ÿ”น

public applyRemovalPolicy(policy: RemovalPolicy): void

Parameters

  • policy RemovalPolicy

Apply the given removal policy to this resource.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).


toString()๐Ÿ”น

public toString(): string

Returns

  • string

Returns a string representation of this construct.


static fromSubnetGroupName(scope, id, subnetGroupName)๐Ÿ”น

public static fromSubnetGroupName(scope: Construct, id: string, subnetGroupName: string): ISubnetGroup

Parameters

  • scope Construct
  • id string
  • subnetGroupName string

Returns

  • ISubnetGroup

Imports an existing subnet group by name.