@digitraffic/common 2025.9.24-1 → 2025.9.24-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -7,6 +7,7 @@ import type { InfraStackConfiguration } from "./intra-stack-configuration.js";
|
|
|
7
7
|
export interface DbConfiguration {
|
|
8
8
|
readonly cluster?: ClusterConfiguration;
|
|
9
9
|
readonly clusterImport?: ClusterImportConfiguration;
|
|
10
|
+
readonly storageEncrypted?: boolean;
|
|
10
11
|
readonly customParameterGroups: AuroraPostgresEngineVersion[];
|
|
11
12
|
readonly workmem?: number;
|
|
12
13
|
/** superuser username and password are fetched from this secret, using keys
|
|
@@ -24,7 +25,6 @@ export interface ClusterConfiguration {
|
|
|
24
25
|
readonly securityGroupId: string;
|
|
25
26
|
readonly snapshotIdentifier?: string;
|
|
26
27
|
readonly dbVersion: AuroraPostgresEngineVersion;
|
|
27
|
-
readonly storageEncrypted?: boolean;
|
|
28
28
|
readonly writer: ClusterDbInstanceConfiguration;
|
|
29
29
|
readonly readers: ClusterDbInstanceConfiguration[];
|
|
30
30
|
}
|
|
@@ -58,7 +58,7 @@ export declare class DbStack extends Stack {
|
|
|
58
58
|
clusterIdentifier: string;
|
|
59
59
|
constructor(scope: Construct, id: string, isc: InfraStackConfiguration, configuration: DbConfiguration);
|
|
60
60
|
createParameterGroups(customVersions: AuroraPostgresEngineVersion[], workmem: number): IParameterGroup[];
|
|
61
|
-
createClusterParameters(secretArn: string, clusterConfiguration: ClusterConfiguration, instanceName: string, vpc: IVpc, securityGroup: ISecurityGroup, parameterGroup: IParameterGroup, rdsKey: Key | undefined): DatabaseClusterProps;
|
|
61
|
+
createClusterParameters(secretArn: string, clusterConfiguration: ClusterConfiguration, instanceName: string, vpc: IVpc, securityGroup: ISecurityGroup, parameterGroup: IParameterGroup, storageEncrypted: boolean | undefined, rdsKey: Key | undefined): DatabaseClusterProps;
|
|
62
62
|
createRDSKey(instanceName: string, environmentName: string): Key;
|
|
63
63
|
createAuroraCluster(isc: InfraStackConfiguration, configuration: DbConfiguration, clusterConfiguration: ClusterConfiguration, parameterGroups: IParameterGroup[], instanceName: string, rdsKey: Key | undefined): DatabaseCluster;
|
|
64
64
|
}
|
|
@@ -52,7 +52,7 @@ export class DbStack extends Stack {
|
|
|
52
52
|
throw new Error("Configure either cluster or clusterImport");
|
|
53
53
|
}
|
|
54
54
|
const instanceName = isc.environmentName + "-db";
|
|
55
|
-
const rdsKey = configuration?.
|
|
55
|
+
const rdsKey = configuration?.storageEncrypted
|
|
56
56
|
? this.createRDSKey(instanceName, isc.environmentName)
|
|
57
57
|
: undefined;
|
|
58
58
|
// create cluster if this is wanted, should do it only once
|
|
@@ -91,7 +91,7 @@ export class DbStack extends Stack {
|
|
|
91
91
|
return pg;
|
|
92
92
|
});
|
|
93
93
|
}
|
|
94
|
-
createClusterParameters(secretArn, clusterConfiguration, instanceName, vpc, securityGroup, parameterGroup, rdsKey) {
|
|
94
|
+
createClusterParameters(secretArn, clusterConfiguration, instanceName, vpc, securityGroup, parameterGroup, storageEncrypted, rdsKey) {
|
|
95
95
|
const secret = Secret.fromSecretCompleteArn(this, "DBSecret", secretArn);
|
|
96
96
|
const defaultDbInstanceProps = {
|
|
97
97
|
autoMinorVersionUpgrade: true,
|
|
@@ -138,7 +138,7 @@ export class DbStack extends Stack {
|
|
|
138
138
|
credentials: Credentials.fromPassword(secret.secretValueFromJson("db.superuser").unsafeUnwrap(), secret.secretValueFromJson("db.superuser.password")),
|
|
139
139
|
parameterGroup,
|
|
140
140
|
monitoringInterval: Duration.seconds(30),
|
|
141
|
-
storageEncrypted:
|
|
141
|
+
storageEncrypted: storageEncrypted ?? true,
|
|
142
142
|
...(rdsKey ? { storageEncryptionKey: rdsKey } : {}),
|
|
143
143
|
};
|
|
144
144
|
}
|
|
@@ -159,7 +159,7 @@ export class DbStack extends Stack {
|
|
|
159
159
|
if (parameterGroups[0] === undefined) {
|
|
160
160
|
throw Error("ParameterGroups should not be empty");
|
|
161
161
|
}
|
|
162
|
-
const parameters = this.createClusterParameters(configuration.secretArn, clusterConfiguration, instanceName, vpc, securityGroup, parameterGroups[0], rdsKey);
|
|
162
|
+
const parameters = this.createClusterParameters(configuration.secretArn, clusterConfiguration, instanceName, vpc, securityGroup, parameterGroups[0], configuration.storageEncrypted, rdsKey);
|
|
163
163
|
let cluster;
|
|
164
164
|
if (clusterConfiguration.snapshotIdentifier) {
|
|
165
165
|
cluster = new DatabaseClusterFromSnapshot(this, instanceName, {
|