# Amazon Aurora DSQL Construct Library

> Version 2.275.0-alpha.0

> **Separate package**
>
> `@aws-cdk/aws-dsql-alpha` is not part of `aws-cdk-lib` — install it separately:
>
> ```sh
> npm install @aws-cdk/aws-dsql-alpha
> pip install aws-cdk.aws-dsql-alpha
> ```
>
> This module is [**experimental**](/stability) (alpha): its API may change in any release, without a major version bump.
---

![cdk-constructs: Experimental](https://img.shields.io/badge/cdk--constructs-experimental-important.svg?style=for-the-badge)

> The APIs of higher level constructs in this module are experimental and under active development.
> They are subject to non-backward compatible changes or removal in any future version. These are
> not subject to the [Semantic Versioning](https://semver.org/) model and breaking changes will be
> announced in the release notes. This means that while you may use them, you may need to update
> your source code when upgrading to a newer version of this package.

---

Amazon Aurora DSQL is a serverless, distributed relational database service optimized for transactional workloads. Aurora DSQL offers virtually unlimited scale and doesn't require you to manage infrastructure. The active-active highly available architecture provides 99.99% single-Region and 99.999% multi-Region availability.

The `@aws-cdk/aws-dsql-alpha` package contains primitives for setting up Aurora DSQL clusters.

```ts
import * as dsql from '@aws-cdk/aws-dsql-alpha';
```

## Creating an Aurora DSQL Cluster

To create an Aurora DSQL cluster, define a [`Cluster`](/v2/docs/@aws-cdk_aws-dsql-alpha.Cluster):

```ts
const cluster = new dsql.Cluster(this, 'Cluster', {
  clusterName: 'my-dsql-cluster',
  deletionProtection: true,
});
```

## Granting Connect Access

You can grant IAM principals the ability to connect to the cluster:

```ts
const role = new iam.Role(this, 'DBRole', { assumedBy: new iam.AccountPrincipal(this.account) });
const cluster = new dsql.Cluster(this, 'Cluster');

// Use one of the following statements to grant the role the necessary permissions
cluster.grantConnect(role); // Grant the role dsql:DbConnect
cluster.grantConnectAdmin(role); // Grant the role dsql:DbConnectAdmin
cluster.grant(role, 'dsql:DbConnect'); // Grant the role the specified actions to the cluster
```

## Types

| Name | Kind | Summary |
| --- | --- | --- |
| [`Cluster`](/v2/docs/@aws-cdk_aws-dsql-alpha.Cluster) | Construct (L2) | Create an Aurora DSQL cluster. |
| [`ClusterAttributes`](/v2/docs/@aws-cdk_aws-dsql-alpha.ClusterAttributes) | Struct | Properties that describe an existing Aurora DSQL cluster. |
| [`ClusterProps`](/v2/docs/@aws-cdk_aws-dsql-alpha.ClusterProps) | Struct | Properties for a new Aurora DSQL cluster. |
| [`ICluster`](/v2/docs/@aws-cdk_aws-dsql-alpha.ICluster) | Interface | Represents an Aurora DSQL cluster. |
