SubnetGroup

class aws_cdk.aws_rds.SubnetGroup(scope, id, *, description, vpc, removal_policy=None, subnet_group_name=None, vpc_subnets=None)

Bases: aws_cdk.core.Resource

Class for creating a RDS DB subnet group.

Resource

AWS::RDS::DBSubnetGroup

Parameters
  • scope (Construct) –

  • id (str) –

  • description (str) – Description of the subnet group.

  • vpc (IVpc) – The VPC to place the subnet group in.

  • removal_policy (Optional[RemovalPolicy]) – The removal policy to apply when the subnet group are removed from the stack or replaced during an update. Default: RemovalPolicy.DESTROY

  • subnet_group_name (Optional[str]) – The name of the subnet group. Default: - a name is generated

  • vpc_subnets (Optional[SubnetSelection]) – Which subnets within the VPC to associate with this group. Default: - private subnets

Methods

to_string()

Returns a string representation of this construct.

Return type

str

Attributes

env

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.

Return type

ResourceEnvironment

node

The construct tree node associated with this construct.

Return type

ConstructNode

stack

The stack in which this resource is defined.

Return type

Stack

subnet_group_name

The name of the subnet group.

Return type

str

Static Methods

classmethod from_subnet_group_name(scope, id, subnet_group_name)

Imports an existing subnet group by name.

Parameters
  • scope (Construct) –

  • id (str) –

  • subnet_group_name (str) –

Return type

ISubnetGroup

classmethod is_construct(x)

Return whether the given object is a Construct.

Parameters

x (Any) –

Return type

bool