@friggframework/devtools 2.0.0--canary.490.c5ad260.0 → 2.0.0--canary.490.b58dfbe.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.
@@ -184,6 +184,11 @@ class VpcBuilder extends InfrastructureBuilder {
184
184
  });
185
185
  }
186
186
  });
187
+
188
+ // Also check for external resources extracted via CloudFormation queries
189
+ // (e.g., VPC ID from security group query, subnets from route table associations)
190
+ // These are NOT in the stack but were discovered through stack resources
191
+ this._addExternalResourcesFromCloudFormationQueries(flatDiscovery, discovery, existingLogicalIds);
187
192
  } else {
188
193
  // Resources discovered from AWS API (not CloudFormation)
189
194
  // These go into external array
@@ -290,6 +295,58 @@ class VpcBuilder extends InfrastructureBuilder {
290
295
  return discovery;
291
296
  }
292
297
 
298
+ /**
299
+ * Add external resources that were discovered via CloudFormation queries
300
+ * (e.g., VPC ID extracted from security group, subnets from route table associations)
301
+ *
302
+ * @private
303
+ */
304
+ _addExternalResourcesFromCloudFormationQueries(flatDiscovery, discovery, existingLogicalIds) {
305
+ // VPC ID extracted from SG or route table (NOT a stack resource)
306
+ if (flatDiscovery.defaultVpcId &&
307
+ typeof flatDiscovery.defaultVpcId === 'string' &&
308
+ !existingLogicalIds.includes('FriggVPC')) {
309
+ discovery.external.push({
310
+ physicalId: flatDiscovery.defaultVpcId,
311
+ resourceType: 'AWS::EC2::VPC',
312
+ source: 'cloudformation-query'
313
+ });
314
+ }
315
+
316
+ // Subnets extracted from route table associations (NOT stack resources)
317
+ if (flatDiscovery.privateSubnetId1 &&
318
+ typeof flatDiscovery.privateSubnetId1 === 'string' &&
319
+ !existingLogicalIds.includes('FriggPrivateSubnet1')) {
320
+ discovery.external.push({
321
+ physicalId: flatDiscovery.privateSubnetId1,
322
+ resourceType: 'AWS::EC2::Subnet',
323
+ source: 'cloudformation-query'
324
+ });
325
+ }
326
+
327
+ if (flatDiscovery.privateSubnetId2 &&
328
+ typeof flatDiscovery.privateSubnetId2 === 'string' &&
329
+ !existingLogicalIds.includes('FriggPrivateSubnet2')) {
330
+ discovery.external.push({
331
+ physicalId: flatDiscovery.privateSubnetId2,
332
+ resourceType: 'AWS::EC2::Subnet',
333
+ source: 'cloudformation-query'
334
+ });
335
+ }
336
+
337
+ // NAT Gateway extracted from route table routes
338
+ if (flatDiscovery.existingNatGatewayId &&
339
+ typeof flatDiscovery.existingNatGatewayId === 'string' &&
340
+ !existingLogicalIds.includes('FriggNATGateway') &&
341
+ !existingLogicalIds.includes('FriggNatGateway')) {
342
+ discovery.external.push({
343
+ physicalId: flatDiscovery.existingNatGatewayId,
344
+ resourceType: 'AWS::EC2::NatGateway',
345
+ source: 'cloudformation-query'
346
+ });
347
+ }
348
+ }
349
+
293
350
  /**
294
351
  * Translate legacy configuration (management modes) to new ownership-based configuration
295
352
  * Provides backwards compatibility for existing app definitions
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.c5ad260.0",
4
+ "version": "2.0.0--canary.490.b58dfbe.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.c5ad260.0",
20
- "@friggframework/schemas": "2.0.0--canary.490.c5ad260.0",
21
- "@friggframework/test": "2.0.0--canary.490.c5ad260.0",
19
+ "@friggframework/core": "2.0.0--canary.490.b58dfbe.0",
20
+ "@friggframework/schemas": "2.0.0--canary.490.b58dfbe.0",
21
+ "@friggframework/test": "2.0.0--canary.490.b58dfbe.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.c5ad260.0",
50
- "@friggframework/prettier-config": "2.0.0--canary.490.c5ad260.0",
49
+ "@friggframework/eslint-config": "2.0.0--canary.490.b58dfbe.0",
50
+ "@friggframework/prettier-config": "2.0.0--canary.490.b58dfbe.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": "c5ad26056632a30d7ce772e3af8209e0b2d2014e"
82
+ "gitHead": "b58dfbe46be9442b592f4a92fb98a4340ec2d146"
83
83
  }