@friggframework/devtools 2.0.0--canary.490.a308628.0 → 2.0.0--canary.490.81a6847.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.
|
@@ -295,6 +295,15 @@ class VpcBuilder extends InfrastructureBuilder {
|
|
|
295
295
|
}
|
|
296
296
|
}
|
|
297
297
|
|
|
298
|
+
// Add flat discovery properties directly to discovery object for resolver access
|
|
299
|
+
// The resolver checks both discovery.defaultSecurityGroupId and discovery.external array
|
|
300
|
+
discovery.defaultVpcId = flatDiscovery.defaultVpcId;
|
|
301
|
+
discovery.defaultSecurityGroupId = flatDiscovery.defaultSecurityGroupId;
|
|
302
|
+
discovery.privateSubnetId1 = flatDiscovery.privateSubnetId1;
|
|
303
|
+
discovery.privateSubnetId2 = flatDiscovery.privateSubnetId2;
|
|
304
|
+
discovery.natGatewayId = flatDiscovery.natGatewayId;
|
|
305
|
+
discovery.lambdaSecurityGroupId = flatDiscovery.lambdaSecurityGroupId;
|
|
306
|
+
|
|
298
307
|
return discovery;
|
|
299
308
|
}
|
|
300
309
|
|
|
@@ -1448,6 +1448,30 @@ describe('VpcBuilder', () => {
|
|
|
1448
1448
|
});
|
|
1449
1449
|
});
|
|
1450
1450
|
|
|
1451
|
+
describe('convertFlatDiscoveryToStructured - Direct Properties', () => {
|
|
1452
|
+
it('should copy flat discovery properties to structured discovery for resolver access', () => {
|
|
1453
|
+
const flatDiscovery = {
|
|
1454
|
+
fromCloudFormationStack: true,
|
|
1455
|
+
defaultVpcId: 'vpc-123',
|
|
1456
|
+
defaultSecurityGroupId: 'sg-default-456',
|
|
1457
|
+
lambdaSecurityGroupId: 'sg-lambda-789',
|
|
1458
|
+
privateSubnetId1: 'subnet-1',
|
|
1459
|
+
privateSubnetId2: 'subnet-2',
|
|
1460
|
+
natGatewayId: 'nat-123'
|
|
1461
|
+
};
|
|
1462
|
+
|
|
1463
|
+
const result = vpcBuilder.convertFlatDiscoveryToStructured(flatDiscovery);
|
|
1464
|
+
|
|
1465
|
+
// Direct properties should be copied for resolver access
|
|
1466
|
+
expect(result.defaultVpcId).toBe('vpc-123');
|
|
1467
|
+
expect(result.defaultSecurityGroupId).toBe('sg-default-456');
|
|
1468
|
+
expect(result.lambdaSecurityGroupId).toBe('sg-lambda-789');
|
|
1469
|
+
expect(result.privateSubnetId1).toBe('subnet-1');
|
|
1470
|
+
expect(result.privateSubnetId2).toBe('subnet-2');
|
|
1471
|
+
expect(result.natGatewayId).toBe('nat-123');
|
|
1472
|
+
});
|
|
1473
|
+
});
|
|
1474
|
+
|
|
1451
1475
|
describe('convertFlatDiscoveryToStructured - VPC Endpoints from CloudFormation', () => {
|
|
1452
1476
|
it('should add VPC endpoints to stackManaged when in existingLogicalIds', () => {
|
|
1453
1477
|
const flatDiscovery = {
|
|
@@ -246,8 +246,31 @@ class CloudFormationDiscovery {
|
|
|
246
246
|
);
|
|
247
247
|
|
|
248
248
|
if (sgDetails.SecurityGroups && sgDetails.SecurityGroups.length > 0) {
|
|
249
|
-
|
|
250
|
-
|
|
249
|
+
const vpcId = sgDetails.SecurityGroups[0].VpcId;
|
|
250
|
+
discovered.defaultVpcId = vpcId;
|
|
251
|
+
console.log(` ✓ Extracted VPC ID from security group: ${vpcId}`);
|
|
252
|
+
|
|
253
|
+
// Now query for the default security group in this VPC
|
|
254
|
+
if (!discovered.defaultSecurityGroupId) {
|
|
255
|
+
try {
|
|
256
|
+
console.log(` Querying for default security group in VPC...`);
|
|
257
|
+
const defaultSgResponse = await ec2Client.send(
|
|
258
|
+
new DescribeSecurityGroupsCommand({
|
|
259
|
+
Filters: [
|
|
260
|
+
{ Name: 'vpc-id', Values: [vpcId] },
|
|
261
|
+
{ Name: 'group-name', Values: ['default'] }
|
|
262
|
+
]
|
|
263
|
+
})
|
|
264
|
+
);
|
|
265
|
+
|
|
266
|
+
if (defaultSgResponse.SecurityGroups && defaultSgResponse.SecurityGroups.length > 0) {
|
|
267
|
+
discovered.defaultSecurityGroupId = defaultSgResponse.SecurityGroups[0].GroupId;
|
|
268
|
+
console.log(` ✓ Discovered default security group: ${discovered.defaultSecurityGroupId}`);
|
|
269
|
+
}
|
|
270
|
+
} catch (error) {
|
|
271
|
+
console.warn(` ⚠️ Could not query default security group: ${error.message}`);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
251
274
|
} else {
|
|
252
275
|
console.warn(` ⚠️ Security group query returned no results`);
|
|
253
276
|
}
|
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.490.
|
|
4
|
+
"version": "2.0.0--canary.490.81a6847.0",
|
|
5
5
|
"bin": {
|
|
6
6
|
"frigg": "./frigg-cli/index.js"
|
|
7
7
|
},
|
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
"@babel/eslint-parser": "^7.18.9",
|
|
17
17
|
"@babel/parser": "^7.25.3",
|
|
18
18
|
"@babel/traverse": "^7.25.3",
|
|
19
|
-
"@friggframework/core": "2.0.0--canary.490.
|
|
20
|
-
"@friggframework/schemas": "2.0.0--canary.490.
|
|
21
|
-
"@friggframework/test": "2.0.0--canary.490.
|
|
19
|
+
"@friggframework/core": "2.0.0--canary.490.81a6847.0",
|
|
20
|
+
"@friggframework/schemas": "2.0.0--canary.490.81a6847.0",
|
|
21
|
+
"@friggframework/test": "2.0.0--canary.490.81a6847.0",
|
|
22
22
|
"@hapi/boom": "^10.0.1",
|
|
23
23
|
"@inquirer/prompts": "^5.3.8",
|
|
24
24
|
"axios": "^1.7.2",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"validate-npm-package-name": "^5.0.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@friggframework/eslint-config": "2.0.0--canary.490.
|
|
50
|
-
"@friggframework/prettier-config": "2.0.0--canary.490.
|
|
49
|
+
"@friggframework/eslint-config": "2.0.0--canary.490.81a6847.0",
|
|
50
|
+
"@friggframework/prettier-config": "2.0.0--canary.490.81a6847.0",
|
|
51
51
|
"aws-sdk-client-mock": "^4.1.0",
|
|
52
52
|
"aws-sdk-client-mock-jest": "^4.1.0",
|
|
53
53
|
"jest": "^30.1.3",
|
|
@@ -79,5 +79,5 @@
|
|
|
79
79
|
"publishConfig": {
|
|
80
80
|
"access": "public"
|
|
81
81
|
},
|
|
82
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "81a684747fa412f872340aaefde6d5661a01b903"
|
|
83
83
|
}
|