@friggframework/devtools 2.0.0--canary.547.67ebb53.0 → 2.0.0--canary.548.0c9482d.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.
@@ -977,7 +977,7 @@ class VpcBuilder extends InfrastructureBuilder {
977
977
  }
978
978
 
979
979
  // Ensure subnet associations
980
- this.ensureSubnetAssociations(appDefinition, {}, result);
980
+ this.ensureSubnetAssociations(appDefinition, discoveredResources, result);
981
981
 
982
982
  // Create endpoints
983
983
  if (endpointsToCreate.includes('s3')) {
@@ -562,7 +562,8 @@ class CloudFormationDiscovery {
562
562
  .map(a => a.SubnetId);
563
563
 
564
564
  console.log(` Route table has ${associatedSubnetIds.length} associated subnets: ${associatedSubnetIds.join(', ')}`);
565
-
565
+ discovered.routeTableAssociationCount = associatedSubnetIds.length;
566
+
566
567
  // Use the associated subnets if available
567
568
  if (associatedSubnetIds.length >= 2) {
568
569
  discovered.privateSubnetId1 = associatedSubnetIds[0];
@@ -118,6 +118,29 @@ async function gatherDiscoveredResources(appDefinition) {
118
118
  appDefinition.vpcIsolation === 'isolated';
119
119
 
120
120
  if (stackResources && hasSomeUsefulData) {
121
+ // Self-heal: if route table exists but has 0 subnet associations, fix via EC2 API
122
+ if (appDefinition.vpc?.selfHeal &&
123
+ stackResources.routeTableId &&
124
+ stackResources.routeTableAssociationCount === 0 &&
125
+ stackResources.privateSubnetId1 && stackResources.privateSubnetId2) {
126
+
127
+ console.log(' ⚠️ Route table has 0 subnet associations - self-healing...');
128
+ try {
129
+ const { AssociateRouteTableCommand } = require('@aws-sdk/client-ec2');
130
+ const ec2 = provider.getEC2Client();
131
+
132
+ for (const subnetId of [stackResources.privateSubnetId1, stackResources.privateSubnetId2]) {
133
+ await ec2.send(new AssociateRouteTableCommand({
134
+ RouteTableId: stackResources.routeTableId,
135
+ SubnetId: subnetId,
136
+ }));
137
+ console.log(` ✓ Self-healed: associated ${subnetId} with ${stackResources.routeTableId}`);
138
+ }
139
+ } catch (error) {
140
+ console.warn(` ⚠️ Self-heal failed: ${error.message}`);
141
+ }
142
+ }
143
+
121
144
  console.log(' ✓ Discovered resources from existing CloudFormation stack');
122
145
  console.log('✅ Cloud resource discovery completed successfully!');
123
146
  return stackResources;
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.547.67ebb53.0",
4
+ "version": "2.0.0--canary.548.0c9482d.0",
5
5
  "bin": {
6
6
  "frigg": "./frigg-cli/index.js"
7
7
  },
@@ -25,9 +25,9 @@
25
25
  "@babel/eslint-parser": "^7.18.9",
26
26
  "@babel/parser": "^7.25.3",
27
27
  "@babel/traverse": "^7.25.3",
28
- "@friggframework/core": "2.0.0--canary.547.67ebb53.0",
29
- "@friggframework/schemas": "2.0.0--canary.547.67ebb53.0",
30
- "@friggframework/test": "2.0.0--canary.547.67ebb53.0",
28
+ "@friggframework/core": "2.0.0--canary.548.0c9482d.0",
29
+ "@friggframework/schemas": "2.0.0--canary.548.0c9482d.0",
30
+ "@friggframework/test": "2.0.0--canary.548.0c9482d.0",
31
31
  "@hapi/boom": "^10.0.1",
32
32
  "@inquirer/prompts": "^5.3.8",
33
33
  "axios": "^1.7.2",
@@ -55,8 +55,8 @@
55
55
  "validate-npm-package-name": "^5.0.0"
56
56
  },
57
57
  "devDependencies": {
58
- "@friggframework/eslint-config": "2.0.0--canary.547.67ebb53.0",
59
- "@friggframework/prettier-config": "2.0.0--canary.547.67ebb53.0",
58
+ "@friggframework/eslint-config": "2.0.0--canary.548.0c9482d.0",
59
+ "@friggframework/prettier-config": "2.0.0--canary.548.0c9482d.0",
60
60
  "aws-sdk-client-mock": "^4.1.0",
61
61
  "aws-sdk-client-mock-jest": "^4.1.0",
62
62
  "jest": "^30.1.3",
@@ -88,5 +88,5 @@
88
88
  "publishConfig": {
89
89
  "access": "public"
90
90
  },
91
- "gitHead": "67ebb5384348b3862e709531b3025d4d2641c08c"
91
+ "gitHead": "0c9482df57d824fb02272a0096db7b8966416b85"
92
92
  }