@friggframework/devtools 2.0.0--canary.461.39132db.0 → 2.0.0--canary.461.f81618e.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.
|
@@ -66,10 +66,20 @@ class KmsBuilder extends InfrastructureBuilder {
|
|
|
66
66
|
plugins: [],
|
|
67
67
|
};
|
|
68
68
|
|
|
69
|
-
//
|
|
70
|
-
|
|
71
|
-
|
|
69
|
+
// Normalize top-level managementMode
|
|
70
|
+
const globalMode = appDefinition.managementMode || 'discover';
|
|
71
|
+
let createIfNoneFound = appDefinition.encryption.createResourceIfNoneFound;
|
|
72
|
+
|
|
73
|
+
if (globalMode === 'managed') {
|
|
74
|
+
// In managed mode, always create KMS if not found
|
|
75
|
+
createIfNoneFound = true;
|
|
76
|
+
if (appDefinition.encryption.createResourceIfNoneFound !== undefined) {
|
|
77
|
+
console.log(` ⚠️ managementMode='managed' ignoring: encryption.createResourceIfNoneFound`);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
72
80
|
|
|
81
|
+
// Check if we should create a new KMS key
|
|
82
|
+
if (!discoveredResources.defaultKmsKeyId && createIfNoneFound === true) {
|
|
73
83
|
console.log(' Creating new KMS key...');
|
|
74
84
|
result.resources = this.createKmsKey(appDefinition);
|
|
75
85
|
result.environment.KMS_KEY_ARN = { 'Fn::GetAtt': ['FriggKMSKey', 'Arn'] };
|
|
@@ -438,15 +438,12 @@ describe('Resource Discovery', () => {
|
|
|
438
438
|
expect(mockAuroraDiscovery.discover).not.toHaveBeenCalled();
|
|
439
439
|
});
|
|
440
440
|
|
|
441
|
-
it('should
|
|
441
|
+
it('should return empty in isolated mode even if stack exists (fresh creation)', async () => {
|
|
442
442
|
const { CloudFormationDiscovery } = require('./cloudformation-discovery');
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
auroraClusterId: 'cluster-stage-specific',
|
|
446
|
-
});
|
|
447
|
-
|
|
443
|
+
|
|
444
|
+
// Mock that CF stack exists but we still want fresh resources
|
|
448
445
|
CloudFormationDiscovery.mockImplementation(() => ({
|
|
449
|
-
discoverFromStack:
|
|
446
|
+
discoverFromStack: jest.fn().mockResolvedValue({}), // Stack exists but empty
|
|
450
447
|
}));
|
|
451
448
|
|
|
452
449
|
const appDefinition = {
|
|
@@ -460,11 +457,12 @@ describe('Resource Discovery', () => {
|
|
|
460
457
|
|
|
461
458
|
const result = await gatherDiscoveredResources(appDefinition);
|
|
462
459
|
|
|
463
|
-
//
|
|
464
|
-
|
|
460
|
+
// In isolated mode, always return empty to force fresh creation
|
|
461
|
+
// This prevents any cross-stage resource reuse
|
|
462
|
+
expect(result).toEqual({});
|
|
465
463
|
|
|
466
|
-
//
|
|
467
|
-
expect(
|
|
464
|
+
// Should NOT call AWS API discovery
|
|
465
|
+
expect(mockVpcDiscovery.discover).not.toHaveBeenCalled();
|
|
468
466
|
});
|
|
469
467
|
|
|
470
468
|
it('should use AWS API discovery in shared mode', async () => {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@friggframework/devtools",
|
|
3
3
|
"prettier": "@friggframework/prettier-config",
|
|
4
|
-
"version": "2.0.0--canary.461.
|
|
4
|
+
"version": "2.0.0--canary.461.f81618e.0",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@aws-sdk/client-ec2": "^3.835.0",
|
|
7
7
|
"@aws-sdk/client-kms": "^3.835.0",
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
"@babel/eslint-parser": "^7.18.9",
|
|
12
12
|
"@babel/parser": "^7.25.3",
|
|
13
13
|
"@babel/traverse": "^7.25.3",
|
|
14
|
-
"@friggframework/schemas": "2.0.0--canary.461.
|
|
15
|
-
"@friggframework/test": "2.0.0--canary.461.
|
|
14
|
+
"@friggframework/schemas": "2.0.0--canary.461.f81618e.0",
|
|
15
|
+
"@friggframework/test": "2.0.0--canary.461.f81618e.0",
|
|
16
16
|
"@hapi/boom": "^10.0.1",
|
|
17
17
|
"@inquirer/prompts": "^5.3.8",
|
|
18
18
|
"axios": "^1.7.2",
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"serverless-http": "^2.7.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@friggframework/eslint-config": "2.0.0--canary.461.
|
|
38
|
-
"@friggframework/prettier-config": "2.0.0--canary.461.
|
|
37
|
+
"@friggframework/eslint-config": "2.0.0--canary.461.f81618e.0",
|
|
38
|
+
"@friggframework/prettier-config": "2.0.0--canary.461.f81618e.0",
|
|
39
39
|
"aws-sdk-client-mock": "^4.1.0",
|
|
40
40
|
"aws-sdk-client-mock-jest": "^4.1.0",
|
|
41
41
|
"jest": "^30.1.3",
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
"publishConfig": {
|
|
71
71
|
"access": "public"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "f81618e26251ee880f57bb29ffefe7decec796b5"
|
|
74
74
|
}
|