class Cluster (construct)
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.DSQL.Alpha.Cluster |
Go | github.com/aws/aws-cdk-go/awscdkdsqlalpha/v2#Cluster |
Java | software.amazon.awscdk.services.dsql.alpha.Cluster |
Python | aws_cdk.aws_dsql_alpha.Cluster |
TypeScript (source) | @aws-cdk/aws-dsql-alpha ยป Cluster |
Implements
IConstruct, IDependable, IResource, IEnvironment, ICluster
Create an Aurora DSQL cluster.
Example
const cluster = new dsql.Cluster(this, 'Cluster', {
clusterName: 'my-dsql-cluster',
deletionProtection: true,
});
Initializer
new Cluster(scope: Construct, id: string, props?: ClusterProps)
Parameters
- scope
Construct - id
string - props
ClusterProps
Construct Props
| Name | Type | Description |
|---|---|---|
| cluster | string | The name of the DSQL cluster. |
| deletion | boolean | Specifies whether this cluster can be deleted. |
| removal | Removal | The removal policy to apply when the cluster is removed or replaced during a stack update, or when the stack is deleted. |
clusterName?
Type:
string
(optional, default: No name specified.)
The name of the DSQL cluster.
This is applied via the Name tag.
deletionProtection?
Type:
boolean
(optional, default: true if removalPolicy is RETAIN, undefined otherwise.)
Specifies whether this cluster can be deleted.
If deletionProtection is enabled, the cluster cannot be deleted unless it is modified and deletionProtection is disabled. deletionProtection protects clusters from being accidentally deleted.
removalPolicy?
Type:
Removal
(optional, default: Retain cluster.)
The removal policy to apply when the cluster is removed or replaced during a stack update, or when the stack is deleted.
Properties
| Name | Type | Description |
|---|---|---|
| cluster | string | Arn of the cluster. |
| cluster | string | Connection endpoint for the cluster. |
| cluster | string | Identifier of the cluster. |
| env | Resource | The environment this resource belongs to. |
| node | Node | The tree node. |
| stack | Stack | The stack in which this resource is defined. |
| vpc | string | VPC endpoint service name for the cluster. |
clusterArn
Type:
string
Arn of the cluster.
clusterEndpoint
Type:
string
Connection endpoint for the cluster.
clusterIdentifier
Type:
string
Identifier of the cluster.
env
Type:
Resource
The environment this resource belongs to.
For resources that are created and managed in a Stack (those created by
creating new class instances like new Role(), new Bucket(), etc.), this
is always the same as the environment of the stack they belong to.
For referenced resources (those obtained from referencing methods like
Role.fromRoleArn(), Bucket.fromBucketName(), etc.), they 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.
vpcEndpointServiceName
Type:
string
VPC endpoint service name for the cluster.
Methods
| Name | Description |
|---|---|
| apply | Apply the given removal policy to this resource. |
| grant(grantee, ...actions) | Grant the given identity the specified actions. |
| grant | Grant the given identity permission to connect to the database. |
| grant | Grant the given identity permission to connect to the database with admin role. |
| to | Returns a string representation of this construct. |
| with(...mixins) | Applies one or more mixins to this construct. |
| static from | Import an existing Cluster from attributes. |
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).
grant(grantee, ...actions)
public grant(grantee: IGrantable, ...actions: string[]): Grant
Parameters
- grantee
IGrantable - actions
string
Returns
Grant the given identity the specified actions.
grantConnect(grantee)
public grantConnect(grantee: IGrantable): Grant
Parameters
- grantee
IGrantable
Returns
Grant the given identity permission to connect to the database.
[disable-awslint:no-grants]
grantConnectAdmin(grantee)
public grantConnectAdmin(grantee: IGrantable): Grant
Parameters
- grantee
IGrantable
Returns
Grant the given identity permission to connect to the database with admin role.
[disable-awslint:no-grants]
toString()
public toString(): string
Returns
string
Returns a string representation of this construct.
with(...mixins)
public with(...mixins: IMixin[]): IConstruct
Parameters
- mixins
IMixin
Returns
Applies one or more mixins to this construct.
Mixins are applied in order. The list of constructs is captured at the
start of the call, so constructs added by a mixin will not be visited.
Use multiple with() calls if subsequent mixins should apply to added
constructs.
static fromClusterAttributes(scope, id, attrs)
public static fromClusterAttributes(scope: Construct, id: string, attrs: ClusterAttributes): ICluster
Parameters
- scope
Construct - id
string - attrs
ClusterAttributes
Returns
Import an existing Cluster from attributes.

.NET
Go
Java
Python
TypeScript (