@friggframework/devtools 2.0.0--canary.490.97a854f.0 → 2.0.0--canary.490.9b2c8b2.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.
@@ -162,21 +162,24 @@ class VpcBuilder extends InfrastructureBuilder {
162
162
  } else if (logicalId === 'FriggLambdaRouteTable') {
163
163
  resourceType = 'AWS::EC2::RouteTable';
164
164
  physicalId = flatDiscovery.routeTableId;
165
- } else if (logicalId === 'FriggS3VPCEndpoint') {
165
+ } else if (logicalId === 'FriggS3VPCEndpoint' || logicalId === 'VPCEndpointS3') {
166
166
  resourceType = 'AWS::EC2::VPCEndpoint';
167
167
  physicalId = flatDiscovery.s3VpcEndpointId;
168
- } else if (logicalId === 'FriggDynamoDBVPCEndpoint') {
168
+ } else if (logicalId === 'FriggDynamoDBVPCEndpoint' || logicalId === 'VPCEndpointDynamoDB') {
169
169
  resourceType = 'AWS::EC2::VPCEndpoint';
170
170
  physicalId = flatDiscovery.dynamodbVpcEndpointId;
171
- } else if (logicalId === 'FriggKMSVPCEndpoint') {
171
+ } else if (logicalId === 'FriggKMSVPCEndpoint' || logicalId === 'VPCEndpointKMS') {
172
172
  resourceType = 'AWS::EC2::VPCEndpoint';
173
173
  physicalId = flatDiscovery.kmsVpcEndpointId;
174
- } else if (logicalId === 'FriggSecretsManagerVPCEndpoint') {
174
+ } else if (logicalId === 'FriggSecretsManagerVPCEndpoint' || logicalId === 'VPCEndpointSecretsManager') {
175
175
  resourceType = 'AWS::EC2::VPCEndpoint';
176
176
  physicalId = flatDiscovery.secretsManagerVpcEndpointId;
177
- } else if (logicalId === 'FriggSQSVPCEndpoint') {
177
+ } else if (logicalId === 'FriggSQSVPCEndpoint' || logicalId === 'VPCEndpointSQS') {
178
178
  resourceType = 'AWS::EC2::VPCEndpoint';
179
179
  physicalId = flatDiscovery.sqsVpcEndpointId;
180
+ } else if (logicalId === 'FriggNATRoute' || logicalId === 'FriggPrivateRoute') {
181
+ resourceType = 'AWS::EC2::Route';
182
+ physicalId = flatDiscovery.natRoute;
180
183
  }
181
184
 
182
185
  if (physicalId && typeof physicalId === 'string') {
@@ -1535,6 +1535,47 @@ describe('VpcBuilder', () => {
1535
1535
  // Route table should still be created
1536
1536
  expect(result.resources.FriggLambdaRouteTable).toBeDefined();
1537
1537
  });
1538
+
1539
+ it('should convert OLD logical IDs to structured discovery stackManaged array', () => {
1540
+ // TDD test: Verify that VPCEndpointS3 in existingLogicalIds gets added to stackManaged
1541
+ const flatDiscovery = {
1542
+ fromCloudFormationStack: true,
1543
+ stackName: 'create-frigg-app-production',
1544
+ existingLogicalIds: [
1545
+ 'VPCEndpointS3', // OLD naming
1546
+ 'VPCEndpointDynamoDB', // OLD naming
1547
+ 'FriggNATRoute' // OLD naming
1548
+ ],
1549
+ s3VpcEndpointId: 'vpce-0352ceac2124c14be',
1550
+ dynamodbVpcEndpointId: 'vpce-0b06c4f631199ea68',
1551
+ natRoute: 'rtb-xxx|0.0.0.0/0'
1552
+ };
1553
+
1554
+ const structured = vpcBuilder.convertFlatDiscoveryToStructured(flatDiscovery);
1555
+
1556
+ // CRITICAL: Old logical IDs should be in stackManaged array
1557
+ expect(structured.stackManaged).toContainEqual(
1558
+ expect.objectContaining({
1559
+ logicalId: 'VPCEndpointS3',
1560
+ physicalId: 'vpce-0352ceac2124c14be',
1561
+ resourceType: 'AWS::EC2::VPCEndpoint'
1562
+ })
1563
+ );
1564
+ expect(structured.stackManaged).toContainEqual(
1565
+ expect.objectContaining({
1566
+ logicalId: 'VPCEndpointDynamoDB',
1567
+ physicalId: 'vpce-0b06c4f631199ea68',
1568
+ resourceType: 'AWS::EC2::VPCEndpoint'
1569
+ })
1570
+ );
1571
+ expect(structured.stackManaged).toContainEqual(
1572
+ expect.objectContaining({
1573
+ logicalId: 'FriggNATRoute',
1574
+ physicalId: 'rtb-xxx|0.0.0.0/0',
1575
+ resourceType: 'AWS::EC2::Route'
1576
+ })
1577
+ );
1578
+ });
1538
1579
  });
1539
1580
 
1540
1581
  describe('convertFlatDiscoveryToStructured - Direct Properties', () => {
@@ -163,6 +163,9 @@ class CloudFormationDiscovery {
163
163
  const associations = routeTable.Associations || [];
164
164
  const subnetAssociations = associations.filter(a => a.SubnetId);
165
165
 
166
+ console.log(` DEBUG: Route table has ${associations.length} associations, ${subnetAssociations.length} with SubnetId`);
167
+ console.log(` DEBUG: discovered.privateSubnetId1 = ${discovered.privateSubnetId1}, discovered.privateSubnetId2 = ${discovered.privateSubnetId2}`);
168
+
166
169
  if (subnetAssociations.length >= 1 && !discovered.privateSubnetId1) {
167
170
  discovered.privateSubnetId1 = subnetAssociations[0].SubnetId;
168
171
  console.log(` ✓ Extracted private subnet 1 from associations: ${subnetAssociations[0].SubnetId}`);
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.97a854f.0",
4
+ "version": "2.0.0--canary.490.9b2c8b2.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.97a854f.0",
20
- "@friggframework/schemas": "2.0.0--canary.490.97a854f.0",
21
- "@friggframework/test": "2.0.0--canary.490.97a854f.0",
19
+ "@friggframework/core": "2.0.0--canary.490.9b2c8b2.0",
20
+ "@friggframework/schemas": "2.0.0--canary.490.9b2c8b2.0",
21
+ "@friggframework/test": "2.0.0--canary.490.9b2c8b2.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.97a854f.0",
50
- "@friggframework/prettier-config": "2.0.0--canary.490.97a854f.0",
49
+ "@friggframework/eslint-config": "2.0.0--canary.490.9b2c8b2.0",
50
+ "@friggframework/prettier-config": "2.0.0--canary.490.9b2c8b2.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": "97a854f72031827c40d59dc5e28c2282f433c8ee"
82
+ "gitHead": "9b2c8b2f68fb28726197404adf9531f5f6e0b229"
83
83
  }