@friggframework/devtools 2.0.0--canary.490.e3e31cf.0 → 2.0.0--canary.490.b93c127.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.
@@ -558,6 +558,66 @@ class CloudFormationDiscovery {
558
558
  }
559
559
  }
560
560
 
561
+ // Extract subnet IDs from route table associations (if route table query didn't populate them)
562
+ // Query EC2 to describe the association and get the subnet ID
563
+ console.log(` DEBUG: Checking subnet association extraction - _subnet1AssociationId: ${discovered._subnet1AssociationId}, _subnet2AssociationId: ${discovered._subnet2AssociationId}`);
564
+
565
+ if (!discovered.privateSubnetId1 && discovered._subnet1AssociationId && this.provider && this.provider.getEC2Client) {
566
+ try {
567
+ console.log(` Querying EC2 for subnet from association ${discovered._subnet1AssociationId}...`);
568
+ const { DescribeRouteTablesCommand } = require('@aws-sdk/client-ec2');
569
+ const ec2 = this.provider.getEC2Client();
570
+
571
+ // Query route table by association ID to get subnet
572
+ const rtResponse = await ec2.send(new DescribeRouteTablesCommand({
573
+ Filters: [
574
+ { Name: 'association.association-id', Values: [discovered._subnet1AssociationId] }
575
+ ]
576
+ }));
577
+
578
+ if (rtResponse.RouteTables && rtResponse.RouteTables[0]) {
579
+ const assoc = rtResponse.RouteTables[0].Associations.find(a =>
580
+ a.RouteTableAssociationId === discovered._subnet1AssociationId
581
+ );
582
+ if (assoc && assoc.SubnetId) {
583
+ discovered.privateSubnetId1 = assoc.SubnetId;
584
+ console.log(` ✓ Extracted private subnet 1 from association query: ${assoc.SubnetId}`);
585
+ }
586
+ }
587
+ } catch (error) {
588
+ console.warn(` ⚠️ Could not query subnet from association: ${error.message}`);
589
+ }
590
+ }
591
+
592
+ if (!discovered.privateSubnetId2 && discovered._subnet2AssociationId && this.provider && this.provider.getEC2Client) {
593
+ try {
594
+ const { DescribeRouteTablesCommand } = require('@aws-sdk/client-ec2');
595
+ const ec2 = this.provider.getEC2Client();
596
+
597
+ const rtResponse = await ec2.send(new DescribeRouteTablesCommand({
598
+ Filters: [
599
+ { Name: 'association.association-id', Values: [discovered._subnet2AssociationId] }
600
+ ]
601
+ }));
602
+
603
+ if (rtResponse.RouteTables && rtResponse.RouteTables[0]) {
604
+ const assoc = rtResponse.RouteTables[0].Associations.find(a =>
605
+ a.RouteTableAssociationId === discovered._subnet2AssociationId
606
+ );
607
+ if (assoc && assoc.SubnetId) {
608
+ discovered.privateSubnetId2 = assoc.SubnetId;
609
+ console.log(` ✓ Extracted private subnet 2 from association query: ${assoc.SubnetId}`);
610
+ }
611
+ }
612
+ } catch (error) {
613
+ console.warn(` ⚠️ Could not query subnet from association: ${error.message}`);
614
+ }
615
+ }
616
+
617
+ // Clean up temporary association IDs
618
+ delete discovered._subnet1AssociationId;
619
+ delete discovered._subnet2AssociationId;
620
+
561
621
  // Check for KMS key alias via AWS API if not found in stack resources
562
622
  // This handles cases where the alias was created outside CloudFormation
563
623
  if (!discovered.defaultKmsKeyId && !discovered.kmsKeyAlias &&
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.e3e31cf.0",
4
+ "version": "2.0.0--canary.490.b93c127.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.e3e31cf.0",
20
- "@friggframework/schemas": "2.0.0--canary.490.e3e31cf.0",
21
- "@friggframework/test": "2.0.0--canary.490.e3e31cf.0",
19
+ "@friggframework/core": "2.0.0--canary.490.b93c127.0",
20
+ "@friggframework/schemas": "2.0.0--canary.490.b93c127.0",
21
+ "@friggframework/test": "2.0.0--canary.490.b93c127.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.e3e31cf.0",
50
- "@friggframework/prettier-config": "2.0.0--canary.490.e3e31cf.0",
49
+ "@friggframework/eslint-config": "2.0.0--canary.490.b93c127.0",
50
+ "@friggframework/prettier-config": "2.0.0--canary.490.b93c127.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": "e3e31cf34e6195098c2b8fec081c4d81db52cdda"
82
+ "gitHead": "b93c1271110aaecf2fb36d5b9b39d35fad1c4dc5"
83
83
  }