@friggframework/devtools 2.0.0--canary.461.f81618e.0 → 2.0.0--canary.461.e5a72ea.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.
@@ -683,12 +683,61 @@ class VpcBuilder extends InfrastructureBuilder {
683
683
  },
684
684
  };
685
685
 
686
- // Create routing for the new NAT Gateway
686
+ // Create public routing (public subnets Internet Gateway)
687
+ this.createPublicRouting(appDefinition, result);
688
+
689
+ // Create routing for the new NAT Gateway (private subnets → NAT → IGW)
687
690
  this.createNatGatewayRouting(appDefinition, discoveredResources, result, { Ref: 'FriggNATGateway' });
688
691
 
689
692
  console.log(' ✅ NAT Gateway infrastructure created');
690
693
  }
691
694
 
695
+ /**
696
+ * Create public route table with Internet Gateway route
697
+ * Required for NAT Gateway to have internet access
698
+ */
699
+ createPublicRouting(appDefinition, result) {
700
+ // Public route table with Internet Gateway route
701
+ result.resources.FriggPublicRouteTable = {
702
+ Type: 'AWS::EC2::RouteTable',
703
+ Properties: {
704
+ VpcId: result.vpcId,
705
+ Tags: [
706
+ { Key: 'Name', Value: '${self:service}-${self:provider.stage}-public-rt' },
707
+ { Key: 'ManagedBy', Value: 'Frigg' },
708
+ ],
709
+ },
710
+ };
711
+
712
+ // Route to Internet Gateway
713
+ result.resources.FriggPublicRoute = {
714
+ Type: 'AWS::EC2::Route',
715
+ DependsOn: 'FriggVPCGatewayAttachment',
716
+ Properties: {
717
+ RouteTableId: { Ref: 'FriggPublicRouteTable' },
718
+ DestinationCidrBlock: '0.0.0.0/0',
719
+ GatewayId: { Ref: 'FriggInternetGateway' },
720
+ },
721
+ };
722
+
723
+ // Associate public subnets with public route table
724
+ result.resources.FriggPublicSubnet1RouteTableAssociation = {
725
+ Type: 'AWS::EC2::SubnetRouteTableAssociation',
726
+ Properties: {
727
+ SubnetId: { Ref: 'FriggPublicSubnet' },
728
+ RouteTableId: { Ref: 'FriggPublicRouteTable' },
729
+ },
730
+ };
731
+
732
+ result.resources.FriggPublicSubnet2RouteTableAssociation = {
733
+ Type: 'AWS::EC2::SubnetRouteTableAssociation',
734
+ Properties: {
735
+ SubnetId: { Ref: 'FriggPublicSubnet2' },
736
+ RouteTableId: { Ref: 'FriggPublicRouteTable' },
737
+ },
738
+ };
739
+ }
740
+
692
741
  /**
693
742
  * Create route table and associations for NAT Gateway
694
743
  */
@@ -432,7 +432,7 @@ describe('Resource Discovery', () => {
432
432
 
433
433
  // Should return empty (no discovery)
434
434
  expect(result).toEqual({});
435
-
435
+
436
436
  // Should NOT call AWS API discovery
437
437
  expect(mockVpcDiscovery.discover).not.toHaveBeenCalled();
438
438
  expect(mockAuroraDiscovery.discover).not.toHaveBeenCalled();
@@ -440,7 +440,7 @@ describe('Resource Discovery', () => {
440
440
 
441
441
  it('should return empty in isolated mode even if stack exists (fresh creation)', async () => {
442
442
  const { CloudFormationDiscovery } = require('./cloudformation-discovery');
443
-
443
+
444
444
  // Mock that CF stack exists but we still want fresh resources
445
445
  CloudFormationDiscovery.mockImplementation(() => ({
446
446
  discoverFromStack: jest.fn().mockResolvedValue({}), // Stack exists but empty
@@ -460,7 +460,7 @@ describe('Resource Discovery', () => {
460
460
  // In isolated mode, always return empty to force fresh creation
461
461
  // This prevents any cross-stage resource reuse
462
462
  expect(result).toEqual({});
463
-
463
+
464
464
  // Should NOT call AWS API discovery
465
465
  expect(mockVpcDiscovery.discover).not.toHaveBeenCalled();
466
466
  });
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.461.f81618e.0",
4
+ "version": "2.0.0--canary.461.e5a72ea.0",
5
5
  "dependencies": {
6
6
  "@aws-sdk/client-ec2": "^3.835.0",
7
7
  "@aws-sdk/client-kms": "^3.835.0",
@@ -11,8 +11,8 @@
11
11
  "@babel/eslint-parser": "^7.18.9",
12
12
  "@babel/parser": "^7.25.3",
13
13
  "@babel/traverse": "^7.25.3",
14
- "@friggframework/schemas": "2.0.0--canary.461.f81618e.0",
15
- "@friggframework/test": "2.0.0--canary.461.f81618e.0",
14
+ "@friggframework/schemas": "2.0.0--canary.461.e5a72ea.0",
15
+ "@friggframework/test": "2.0.0--canary.461.e5a72ea.0",
16
16
  "@hapi/boom": "^10.0.1",
17
17
  "@inquirer/prompts": "^5.3.8",
18
18
  "axios": "^1.7.2",
@@ -34,8 +34,8 @@
34
34
  "serverless-http": "^2.7.0"
35
35
  },
36
36
  "devDependencies": {
37
- "@friggframework/eslint-config": "2.0.0--canary.461.f81618e.0",
38
- "@friggframework/prettier-config": "2.0.0--canary.461.f81618e.0",
37
+ "@friggframework/eslint-config": "2.0.0--canary.461.e5a72ea.0",
38
+ "@friggframework/prettier-config": "2.0.0--canary.461.e5a72ea.0",
39
39
  "aws-sdk-client-mock": "^4.1.0",
40
40
  "aws-sdk-client-mock-jest": "^4.1.0",
41
41
  "jest": "^30.1.3",
@@ -70,5 +70,5 @@
70
70
  "publishConfig": {
71
71
  "access": "public"
72
72
  },
73
- "gitHead": "f81618e26251ee880f57bb29ffefe7decec796b5"
73
+ "gitHead": "e5a72eac2f310ebb36765fbc2e810ca850f2cd9f"
74
74
  }