@friggframework/devtools 2.0.0--canary.461.08110d8.0 → 2.0.0--canary.461.1b7292f.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.
@@ -40,9 +40,9 @@ class CloudFormationDiscovery {
40
40
  this._extractFromOutputs(stack.Outputs, discovered);
41
41
  }
42
42
 
43
- // Extract from resources
43
+ // Extract from resources (now async to query AWS for details)
44
44
  if (resources && resources.length > 0) {
45
- this._extractFromResources(resources, discovered);
45
+ await this._extractFromResources(resources, discovered);
46
46
  }
47
47
 
48
48
  return discovered;
@@ -107,10 +107,30 @@ class CloudFormationDiscovery {
107
107
  * @param {Array} resources - CloudFormation stack resources
108
108
  * @param {Object} discovered - Object to populate with discovered resources
109
109
  */
110
- _extractFromResources(resources, discovered) {
110
+ async _extractFromResources(resources, discovered) {
111
111
  for (const resource of resources) {
112
112
  const { LogicalResourceId, PhysicalResourceId, ResourceType } = resource;
113
113
 
114
+ // Security Group - use to get VPC ID
115
+ if (LogicalResourceId === 'FriggLambdaSecurityGroup' && ResourceType === 'AWS::EC2::SecurityGroup') {
116
+ discovered.securityGroupId = PhysicalResourceId;
117
+ // Query security group to get VPC ID
118
+ if (this.provider && !discovered.vpcId) {
119
+ try {
120
+ const sgDetails = await this.provider.getEC2Client().send(
121
+ new (require('@aws-sdk/client-ec2').DescribeSecurityGroupsCommand)({
122
+ GroupIds: [PhysicalResourceId]
123
+ })
124
+ );
125
+ if (sgDetails.SecurityGroups && sgDetails.SecurityGroups.length > 0) {
126
+ discovered.vpcId = sgDetails.SecurityGroups[0].VpcId;
127
+ }
128
+ } catch (error) {
129
+ console.warn(`Could not get VPC from security group: ${error.message}`);
130
+ }
131
+ }
132
+ }
133
+
114
134
  // Aurora cluster
115
135
  if (LogicalResourceId === 'FriggAuroraCluster' && ResourceType === 'AWS::RDS::DBCluster') {
116
136
  discovered.auroraClusterId = PhysicalResourceId;
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.08110d8.0",
4
+ "version": "2.0.0--canary.461.1b7292f.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.08110d8.0",
15
- "@friggframework/test": "2.0.0--canary.461.08110d8.0",
14
+ "@friggframework/schemas": "2.0.0--canary.461.1b7292f.0",
15
+ "@friggframework/test": "2.0.0--canary.461.1b7292f.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.08110d8.0",
38
- "@friggframework/prettier-config": "2.0.0--canary.461.08110d8.0",
37
+ "@friggframework/eslint-config": "2.0.0--canary.461.1b7292f.0",
38
+ "@friggframework/prettier-config": "2.0.0--canary.461.1b7292f.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": "08110d82ea0661a2e88d4be5158fd655ba2ec8b9"
73
+ "gitHead": "1b7292f30e11b350a075d5dcecded3c8c0f21167"
74
74
  }