@friggframework/devtools 2.0.0--canary.461.1b7292f.0 → 2.0.0--canary.461.e6fc7c7.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.
@@ -28,7 +28,7 @@ class CloudFormationDiscovery {
28
28
  try {
29
29
  // Try to get the stack
30
30
  const stack = await this.provider.describeStack(stackName);
31
-
31
+
32
32
  // Get stack resources
33
33
  const resources = await this.provider.listStackResources(stackName);
34
34
 
@@ -51,7 +51,7 @@ class CloudFormationDiscovery {
51
51
  if (error.message && error.message.includes('does not exist')) {
52
52
  return null;
53
53
  }
54
-
54
+
55
55
  // Other errors - log and return null
56
56
  console.warn(`⚠️ CloudFormation discovery failed: ${error.message}`);
57
57
  return null;
@@ -73,18 +73,18 @@ class CloudFormationDiscovery {
73
73
 
74
74
  // VPC outputs
75
75
  if (outputMap.VpcId) {
76
- discovered.vpcId = outputMap.VpcId;
76
+ discovered.defaultVpcId = outputMap.VpcId; // VpcBuilder expects 'defaultVpcId'
77
77
  }
78
-
78
+
79
79
  if (outputMap.PrivateSubnetIds) {
80
80
  // Handle comma-separated subnet IDs
81
81
  discovered.privateSubnetIds = outputMap.PrivateSubnetIds.split(',').map(id => id.trim());
82
82
  }
83
-
83
+
84
84
  if (outputMap.PublicSubnetId) {
85
85
  discovered.publicSubnetId = outputMap.PublicSubnetId;
86
86
  }
87
-
87
+
88
88
  if (outputMap.SecurityGroupId) {
89
89
  discovered.securityGroupId = outputMap.SecurityGroupId;
90
90
  }
@@ -114,19 +114,25 @@ class CloudFormationDiscovery {
114
114
  // Security Group - use to get VPC ID
115
115
  if (LogicalResourceId === 'FriggLambdaSecurityGroup' && ResourceType === 'AWS::EC2::SecurityGroup') {
116
116
  discovered.securityGroupId = PhysicalResourceId;
117
+ console.log(` ✓ Found security group in stack: ${PhysicalResourceId}`);
117
118
  // Query security group to get VPC ID
118
- if (this.provider && !discovered.vpcId) {
119
+ if (this.provider && !discovered.defaultVpcId) {
119
120
  try {
121
+ console.log(` Querying security group to get VPC ID...`);
122
+ const { DescribeSecurityGroupsCommand } = require('@aws-sdk/client-ec2');
120
123
  const sgDetails = await this.provider.getEC2Client().send(
121
- new (require('@aws-sdk/client-ec2').DescribeSecurityGroupsCommand)({
124
+ new DescribeSecurityGroupsCommand({
122
125
  GroupIds: [PhysicalResourceId]
123
126
  })
124
127
  );
125
128
  if (sgDetails.SecurityGroups && sgDetails.SecurityGroups.length > 0) {
126
- discovered.vpcId = sgDetails.SecurityGroups[0].VpcId;
129
+ discovered.defaultVpcId = sgDetails.SecurityGroups[0].VpcId; // VpcBuilder expects 'defaultVpcId'
130
+ console.log(` ✓ Extracted VPC ID from security group: ${discovered.defaultVpcId}`);
131
+ } else {
132
+ console.warn(` ⚠️ Security group query returned no results`);
127
133
  }
128
134
  } catch (error) {
129
- console.warn(`Could not get VPC from security group: ${error.message}`);
135
+ console.warn(` ⚠️ Could not get VPC from security group: ${error.message}`);
130
136
  }
131
137
  }
132
138
  }
@@ -48,7 +48,7 @@ describe('CloudFormationDiscovery', () => {
48
48
  const result = await cfDiscovery.discoverFromStack('test-stack');
49
49
 
50
50
  expect(result).toEqual({
51
- vpcId: 'vpc-123',
51
+ defaultVpcId: 'vpc-123', // VpcBuilder expects 'defaultVpcId', not 'vpcId'
52
52
  privateSubnetIds: ['subnet-1', 'subnet-2'],
53
53
  publicSubnetId: 'subnet-3',
54
54
  securityGroupId: 'sg-123',
@@ -197,7 +197,7 @@ describe('CloudFormationDiscovery', () => {
197
197
  const result = await cfDiscovery.discoverFromStack('test-stack');
198
198
 
199
199
  expect(result).toEqual({
200
- vpcId: 'vpc-123',
200
+ defaultVpcId: 'vpc-123', // VpcBuilder expects 'defaultVpcId'
201
201
  defaultKmsKeyId: 'arn:aws:kms:us-east-1:123456789:key/abc',
202
202
  auroraClusterId: 'test-cluster',
203
203
  natGatewayId: 'nat-123',
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.1b7292f.0",
4
+ "version": "2.0.0--canary.461.e6fc7c7.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.1b7292f.0",
15
- "@friggframework/test": "2.0.0--canary.461.1b7292f.0",
14
+ "@friggframework/schemas": "2.0.0--canary.461.e6fc7c7.0",
15
+ "@friggframework/test": "2.0.0--canary.461.e6fc7c7.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.1b7292f.0",
38
- "@friggframework/prettier-config": "2.0.0--canary.461.1b7292f.0",
37
+ "@friggframework/eslint-config": "2.0.0--canary.461.e6fc7c7.0",
38
+ "@friggframework/prettier-config": "2.0.0--canary.461.e6fc7c7.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": "1b7292f30e11b350a075d5dcecded3c8c0f21167"
73
+ "gitHead": "e6fc7c76e03cc5a0698efc4705b005d02d941654"
74
74
  }