aws / aws/aws-cdk

aws-dsql-alpha: Allow setting encryptionKey

Open Beginner friendly
#38,618 1 comment 0 reactions 0 assignees View on GitHub
@aws-cdk/aws-kms effort/small feature-request p2
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
83

Description

### Describe the feature

Allow setting (kms)encryptionKey on dsql.Cluster like

```typescript
const cluster = new dsl.Cluster(scope, "DsqlCluster", {
clusterName: "myClusterName"
deletionProtection: true,
encryptionKey: myEncryptionKey
});
```

### Use Case

Currently we need to either use [L1 (cfn) construct](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_dsql.CfnCluster.html#kmsencryptionkey) for creating a dsql cluster or use an escape hatch of the L2 Cluster construct. If we use a dedicated L2 construct library, I would expect to make it possible to use your own encryption key.

### Proposed Solution

Add new property `encryptionKey` to `ClusterProps` and set it on the underlying `CfnCluster` (the same way like `deletionProtection` [currently](https://github.com/aws/aws-cdk/blob/e48a97f53d08e3cb3f5081dda189c9718dd86c01/packages/%40aws-cdk/aws-dsql-alpha/lib/cluster.ts#L218))

### Other Information

_No response_

### Acknowledgements

- [x] I may be able to implement this feature request
- [ ] This feature might incur a breaking change

### AWS CDK Library version (aws-cdk-lib)

2.262.1

### AWS CDK CLI version

2.1133.0

### Environment details (OS name and version, etc.)

macOS 26.6.2

Contributor guide

Open the contributing guide

Research direction

Start in packages/@aws-cdk/aws-dsql-alpha/lib/cluster.ts, reading ClusterProps and the existing deletionProtection handling. Add the requested encryptionKey property and follow the same path to the underlying CfnCluster. Done means users can provide their own KMS encryption key through the L2 Cluster construct without an escape hatch.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
cloud, databases
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.