@friggframework/devtools 2.0.0--canary.490.2276530.0 → 2.0.0--canary.490.a4a59f3.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.
@@ -550,7 +550,55 @@ class CloudFormationDiscovery {
550
550
  }
551
551
  }
552
552
 
553
- // Extract subnet IDs from route table associations (if route table query didn't populate them)
553
+ // If we have VPC but no subnets, query ALL subnets in VPC and filter by route table
554
+ // This is the OLD approach from aws-discovery.js that worked reliably
555
+ if (discovered.defaultVpcId && !discovered.privateSubnetId1 && !discovered.privateSubnetId2 &&
556
+ discovered.routeTableId && this.provider && this.provider.getEC2Client) {
557
+ try {
558
+ console.log(` Querying ALL subnets in VPC ${discovered.defaultVpcId}...`);
559
+ const { DescribeSubnetsCommand } = require('@aws-sdk/client-ec2');
560
+ const ec2 = this.provider.getEC2Client();
561
+
562
+ const subnetsResponse = await ec2.send(new DescribeSubnetsCommand({
563
+ Filters: [{ Name: 'vpc-id', Values: [discovered.defaultVpcId] }]
564
+ }));
565
+
566
+ console.log(` Found ${subnetsResponse.Subnets?.length || 0} total subnets in VPC`);
567
+
568
+ if (subnetsResponse.Subnets && subnetsResponse.Subnets.length > 0) {
569
+ // Get route table to find associated subnets
570
+ const { DescribeRouteTablesCommand } = require('@aws-sdk/client-ec2');
571
+ const rtResponse = await ec2.send(new DescribeRouteTablesCommand({
572
+ RouteTableIds: [discovered.routeTableId]
573
+ }));
574
+
575
+ if (rtResponse.RouteTables && rtResponse.RouteTables[0]) {
576
+ const associations = rtResponse.RouteTables[0].Associations || [];
577
+ const associatedSubnetIds = associations
578
+ .filter(a => a.SubnetId)
579
+ .map(a => a.SubnetId);
580
+
581
+ console.log(` Route table has ${associatedSubnetIds.length} associated subnets: ${associatedSubnetIds.join(', ')}`);
582
+
583
+ // Use the associated subnets
584
+ if (associatedSubnetIds.length >= 2) {
585
+ discovered.privateSubnetId1 = associatedSubnetIds[0];
586
+ discovered.privateSubnetId2 = associatedSubnetIds[1];
587
+ console.log(` ✓ Extracted subnets from VPC query: ${discovered.privateSubnetId1}, ${discovered.privateSubnetId2}`);
588
+ } else if (associatedSubnetIds.length === 1) {
589
+ // Only 1 associated subnet, use first available subnet as backup
590
+ discovered.privateSubnetId1 = associatedSubnetIds[0];
591
+ discovered.privateSubnetId2 = subnetsResponse.Subnets.find(s => s.SubnetId !== associatedSubnetIds[0])?.SubnetId;
592
+ console.log(` ✓ Extracted subnets (1 from route table, 1 fallback): ${discovered.privateSubnetId1}, ${discovered.privateSubnetId2}`);
593
+ }
594
+ }
595
+ }
596
+ } catch (error) {
597
+ console.warn(` ⚠️ Could not query subnets from VPC: ${error.message}`);
598
+ }
599
+ }
600
+
601
+ // FALLBACK: Extract subnet IDs from route table associations (if VPC query didn't work)
554
602
  // Query EC2 to describe the association and get the subnet ID
555
603
  console.log(` DEBUG: Checking subnet association extraction - _subnet1AssociationId: ${discovered._subnet1AssociationId}, _subnet2AssociationId: ${discovered._subnet2AssociationId}`);
556
604
 
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.2276530.0",
4
+ "version": "2.0.0--canary.490.a4a59f3.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.2276530.0",
20
- "@friggframework/schemas": "2.0.0--canary.490.2276530.0",
21
- "@friggframework/test": "2.0.0--canary.490.2276530.0",
19
+ "@friggframework/core": "2.0.0--canary.490.a4a59f3.0",
20
+ "@friggframework/schemas": "2.0.0--canary.490.a4a59f3.0",
21
+ "@friggframework/test": "2.0.0--canary.490.a4a59f3.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.2276530.0",
50
- "@friggframework/prettier-config": "2.0.0--canary.490.2276530.0",
49
+ "@friggframework/eslint-config": "2.0.0--canary.490.a4a59f3.0",
50
+ "@friggframework/prettier-config": "2.0.0--canary.490.a4a59f3.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": "2276530f198e87c5fa59c08afab91bf6dcd25625"
82
+ "gitHead": "a4a59f34d1a40ec5b2dabb1f737cef4f9ce871a8"
83
83
  }