@aws-cdk_aws-redshift-alpha.ClusterSubnetGroup

class ClusterSubnetGroup (construct) ๐Ÿ”น

LanguageType name
.NETAmazon.CDK.AWS.Redshift.Alpha.ClusterSubnetGroup
Gogithub.com/aws/aws-cdk-go/awscdkredshiftalpha/v2#ClusterSubnetGroup
Javasoftware.amazon.awscdk.services.redshift.alpha.ClusterSubnetGroup
Pythonaws_cdk.aws_redshift_alpha.ClusterSubnetGroup
TypeScript (source)@aws-cdk/aws-redshift-alpha ยป ClusterSubnetGroup

Implements IConstruct, IDependable, IResource, IClusterSubnetGroup

Class for creating a Redshift cluster subnet group.

Example

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as redshift_alpha from '@aws-cdk/aws-redshift-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 clusterSubnetGroup = new redshift_alpha.ClusterSubnetGroup(this, 'MyClusterSubnetGroup', {
  description: 'description',
  vpc: vpc,

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

Initializer

new ClusterSubnetGroup(scope: Construct, id: string, props: ClusterSubnetGroupProps)

Parameters

  • scope Construct
  • id string
  • props ClusterSubnetGroupProps

Construct Props

NameTypeDescription
description๐Ÿ”นstringDescription of the subnet group.
vpc๐Ÿ”นIVpcThe 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.
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.RETAIN)

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


vpcSubnets?๐Ÿ”น

Type: SubnetSelection (optional, default: private subnets)

Which subnets within the VPC to associate with this group.

Properties

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

clusterSubnetGroupName๐Ÿ”น

Type: string

The name of the cluster 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.

Methods

NameDescription
applyRemovalPolicy(policy)๐Ÿ”นApply the given removal policy to this resource.
toString()๐Ÿ”นReturns a string representation of this construct.
static fromClusterSubnetGroupName(scope, id, clusterSubnetGroupName)๐Ÿ”น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 fromClusterSubnetGroupName(scope, id, clusterSubnetGroupName)๐Ÿ”น

public static fromClusterSubnetGroupName(scope: Construct, id: string, clusterSubnetGroupName: string): IClusterSubnetGroup

Parameters

  • scope Construct
  • id string
  • clusterSubnetGroupName string

Returns

  • IClusterSubnetGroup

Imports an existing subnet group by name.