@fjall/components-infrastructure 2.20.0 → 2.21.0
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.
- package/dist/lib/patterns/aws/database.d.ts +0 -1
- package/dist/lib/patterns/aws/database.js +3 -6
- package/dist/lib/resources/aws/database/rdsDefaults.d.ts +0 -2
- package/dist/lib/resources/aws/database/rdsDefaults.js +0 -2
- package/dist/lib/resources/aws/database/rdsHelpers.js +17 -4
- package/dist/lib/utils/databaseTypes.d.ts +0 -1
- package/package.json +8 -8
|
@@ -27,7 +27,6 @@ export declare const DATABASE_ENGINE_CONFIG: Record<DatabaseEngine, {
|
|
|
27
27
|
};
|
|
28
28
|
defaultUsername: string;
|
|
29
29
|
sslParameters: Record<string, string>;
|
|
30
|
-
rotationAppName: string;
|
|
31
30
|
}>;
|
|
32
31
|
export declare function getAuroraClusterEngine(engine: DatabaseEngine): IClusterEngine;
|
|
33
32
|
export declare function getInstanceEngine(engine: DatabaseEngine): IInstanceEngine;
|
|
@@ -19,16 +19,14 @@ export const DATABASE_ENGINE_CONFIG = Object.freeze({
|
|
|
19
19
|
aurora: { version: "16.6", majorVersion: "16" },
|
|
20
20
|
instance: { version: "17.5", majorVersion: "17" },
|
|
21
21
|
defaultUsername: "postgres",
|
|
22
|
-
sslParameters: { "rds.force_ssl": "1" }
|
|
23
|
-
rotationAppName: "SecretsManagerRDSPostgreSQLRotationMultiUser"
|
|
22
|
+
sslParameters: { "rds.force_ssl": "1" }
|
|
24
23
|
},
|
|
25
24
|
mysql: {
|
|
26
25
|
// majorVersion must be Aurora version (3.08.0), NOT MySQL version (8.0)
|
|
27
26
|
aurora: { version: "8.0.mysql_aurora.3.08.0", majorVersion: "3.08.0" },
|
|
28
27
|
instance: { version: "8.4.4", majorVersion: "8.4" },
|
|
29
28
|
defaultUsername: "admin",
|
|
30
|
-
sslParameters: { require_secure_transport: "ON" }
|
|
31
|
-
rotationAppName: "SecretsManagerRDSMySQLRotationMultiUser"
|
|
29
|
+
sslParameters: { require_secure_transport: "ON" }
|
|
32
30
|
}
|
|
33
31
|
});
|
|
34
32
|
const AURORA_ENGINE_FACTORIES = {
|
|
@@ -70,8 +68,7 @@ export function getEngineConfig(engine) {
|
|
|
70
68
|
return {
|
|
71
69
|
family: engine,
|
|
72
70
|
defaultUsername: config.defaultUsername,
|
|
73
|
-
sslParameters: config.sslParameters
|
|
74
|
-
rotationAppName: config.rotationAppName
|
|
71
|
+
sslParameters: config.sslParameters
|
|
75
72
|
};
|
|
76
73
|
}
|
|
77
74
|
/**
|
|
@@ -6,8 +6,6 @@ export declare const RDS_DEFAULTS: Readonly<{
|
|
|
6
6
|
readonly PREFERRED_MAINTENANCE_WINDOW: "Sat:12:30-Sat:20:30";
|
|
7
7
|
/** 1 minute — balances monitoring granularity against CloudWatch costs */
|
|
8
8
|
readonly MONITORING_INTERVAL: Duration;
|
|
9
|
-
/** SecretsManager rotation application version for multi-user rotation */
|
|
10
|
-
readonly ROTATION_APP_VERSION: "1.1.367";
|
|
11
9
|
/** Default backup retention in days — applied uniformly across Aurora and RDS Instance */
|
|
12
10
|
readonly BACKUP_RETENTION_DEFAULT_DAYS: 14;
|
|
13
11
|
/** Default instance type — primary and read-replica must stay in lockstep */
|
|
@@ -6,8 +6,6 @@ export const RDS_DEFAULTS = Object.freeze({
|
|
|
6
6
|
PREFERRED_MAINTENANCE_WINDOW: "Sat:12:30-Sat:20:30",
|
|
7
7
|
/** 1 minute — balances monitoring granularity against CloudWatch costs */
|
|
8
8
|
MONITORING_INTERVAL: Duration.minutes(1),
|
|
9
|
-
/** SecretsManager rotation application version for multi-user rotation */
|
|
10
|
-
ROTATION_APP_VERSION: "1.1.367",
|
|
11
9
|
/** Default backup retention in days — applied uniformly across Aurora and RDS Instance */
|
|
12
10
|
BACKUP_RETENTION_DEFAULT_DAYS: 14,
|
|
13
11
|
/** Default instance type — primary and read-replica must stay in lockstep */
|
|
@@ -2,14 +2,27 @@ import { Duration } from "aws-cdk-lib";
|
|
|
2
2
|
import { SecretRotation, SecretRotationApplication } from "aws-cdk-lib/aws-secretsmanager";
|
|
3
3
|
import { CustomerManagedKey, Secret } from "../secrets/index.js";
|
|
4
4
|
import { ResourceNaming } from "../../../utils/resourceNaming.js";
|
|
5
|
-
import { RDS_DEFAULTS } from "./rdsDefaults.js";
|
|
6
5
|
import { isAwsManagedKey, isCMKRequested } from "../../../utils/databaseTypes.js";
|
|
7
6
|
/** Default PostgreSQL engine configuration used by both Aurora and Instance constructs. */
|
|
8
7
|
export const DEFAULT_POSTGRES_ENGINE_CONFIG = {
|
|
9
8
|
family: "postgresql",
|
|
10
9
|
defaultUsername: "postgres",
|
|
11
|
-
sslParameters: { "rds.force_ssl": "1" }
|
|
12
|
-
|
|
10
|
+
sslParameters: { "rds.force_ssl": "1" }
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* CDK's built-in multi-user rotation SAR applications, keyed by engine family.
|
|
14
|
+
*
|
|
15
|
+
* These MUST be the built-in static instances — never a hand-constructed
|
|
16
|
+
* `new SecretRotationApplication(name, version, …)`. CDK's `SecretRotation`
|
|
17
|
+
* eagerly builds a SAR mapping for all three partitions (aws / aws-cn /
|
|
18
|
+
* aws-us-gov) at synth time; a custom application only registers the `aws`
|
|
19
|
+
* partition's semantic version, so on aws-cdk-lib >= 2.258 synth throws
|
|
20
|
+
* `unsupported partition: aws-cn`. The built-ins carry every partition's
|
|
21
|
+
* version and AWS keeps them current.
|
|
22
|
+
*/
|
|
23
|
+
const MULTI_USER_ROTATION_APPLICATIONS = {
|
|
24
|
+
postgresql: SecretRotationApplication.POSTGRES_ROTATION_MULTI_USER,
|
|
25
|
+
mysql: SecretRotationApplication.MYSQL_ROTATION_MULTI_USER
|
|
13
26
|
};
|
|
14
27
|
/**
|
|
15
28
|
* Resolve a storage encryption key spec into an IKey or undefined.
|
|
@@ -57,7 +70,7 @@ export function addMultiUserSecretRotation(params) {
|
|
|
57
70
|
secretName: ResourceNaming.masterSecretName(params.constructId)
|
|
58
71
|
});
|
|
59
72
|
new SecretRotation(params.scope, `${params.databaseName}SecretRotation`, {
|
|
60
|
-
application:
|
|
73
|
+
application: MULTI_USER_ROTATION_APPLICATIONS[params.engineConfig.family],
|
|
61
74
|
secret: params.databaseSecret,
|
|
62
75
|
masterSecret: masterSecret.secret,
|
|
63
76
|
target: params.target,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fjall/components-infrastructure",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.21.0",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -63,20 +63,20 @@
|
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
65
|
"@aws-sdk/client-organizations": "^3.1038.0",
|
|
66
|
-
"@fjall/generator": "^2.
|
|
67
|
-
"@fjall/util": "^2.
|
|
68
|
-
"constructs": "^10.
|
|
66
|
+
"@fjall/generator": "^2.21.0",
|
|
67
|
+
"@fjall/util": "^2.21.0",
|
|
68
|
+
"constructs": "^10.6.0"
|
|
69
69
|
},
|
|
70
70
|
"overrides": {
|
|
71
71
|
"@smithy/core": "2.5.5"
|
|
72
72
|
},
|
|
73
73
|
"peerDependencies": {
|
|
74
|
-
"aws-cdk": "^2.
|
|
75
|
-
"aws-cdk-lib": "^2.
|
|
76
|
-
"constructs": "^10.
|
|
74
|
+
"aws-cdk": "^2.1128.1",
|
|
75
|
+
"aws-cdk-lib": "^2.260.0",
|
|
76
|
+
"constructs": "^10.6.0"
|
|
77
77
|
},
|
|
78
78
|
"engines": {
|
|
79
79
|
"node": ">=18.0.0"
|
|
80
80
|
},
|
|
81
|
-
"gitHead": "
|
|
81
|
+
"gitHead": "1b8902876c40697183ce8cbc25a0556b11d0ec38"
|
|
82
82
|
}
|