Skip to content

Commit

Permalink
docs: readme update
Browse files Browse the repository at this point in the history
  • Loading branch information
blimmer committed Jan 6, 2025
1 parent 1086ef1 commit a327f10
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions packages/aws-cdk-lib/aws-rds/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1457,6 +1457,23 @@ New database clusters and instances are automatically encrypted at rest when the
[feature flag](https://docs.aws.amazon.com/cdk/v2/guide/featureflags.html) is set to `true`.
You can disable encryption at rest by setting the `storageEncrypted` variable to `false`.

```ts
declare const vpc: ec2.IVpc;

const cluster = new rds.DatabaseCluster(this, 'Cluster', {
engine: rds.DatabaseClusterEngine.AURORA,
vpc,
storageEncrypted: false,
});

const instance = new rds.DatabaseInstance(this, 'Instance', {
engine: rds.DatabaseInstanceEngine.mysql({ version: rds.MysqlEngineVersion.VER_8_0_39 }),
instanceType: ec2.InstanceType.of(ec2.InstanceClass.R7G, ec2.InstanceSize.LARGE),
vpc,
storageEncrypted: false,
});
```

Previously, the default behavior did not enable encryption at rest if the `storageEncrypted` or `storageEncryptionKey`
property were not set. In this case, the `storageEncrypted` property was `undefined`. The new implementation always
explicitly sets the `storageEncrypted` property to `true` or `false`. To prevent replacing existing unencrypted
Expand Down

0 comments on commit a327f10

Please sign in to comment.