@friggframework/devtools 2.0.0--canary.461.08110d8.0 → 2.0.0--canary.461.086dedb.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,36 @@ 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
|
+
console.log(` ✓ Found security group in stack: ${PhysicalResourceId}`);
|
|
118
|
+
// Query security group to get VPC ID
|
|
119
|
+
if (this.provider && !discovered.vpcId) {
|
|
120
|
+
try {
|
|
121
|
+
console.log(` Querying security group to get VPC ID...`);
|
|
122
|
+
const { DescribeSecurityGroupsCommand } = require('@aws-sdk/client-ec2');
|
|
123
|
+
const sgDetails = await this.provider.getEC2Client().send(
|
|
124
|
+
new DescribeSecurityGroupsCommand({
|
|
125
|
+
GroupIds: [PhysicalResourceId]
|
|
126
|
+
})
|
|
127
|
+
);
|
|
128
|
+
if (sgDetails.SecurityGroups && sgDetails.SecurityGroups.length > 0) {
|
|
129
|
+
discovered.vpcId = sgDetails.SecurityGroups[0].VpcId;
|
|
130
|
+
console.log(` ✓ Extracted VPC ID from security group: ${discovered.vpcId}`);
|
|
131
|
+
} else {
|
|
132
|
+
console.warn(` ⚠️ Security group query returned no results`);
|
|
133
|
+
}
|
|
134
|
+
} catch (error) {
|
|
135
|
+
console.warn(` ⚠️ Could not get VPC from security group: ${error.message}`);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
114
140
|
// Aurora cluster
|
|
115
141
|
if (LogicalResourceId === 'FriggAuroraCluster' && ResourceType === 'AWS::RDS::DBCluster') {
|
|
116
142
|
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.
|
|
4
|
+
"version": "2.0.0--canary.461.086dedb.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.
|
|
15
|
-
"@friggframework/test": "2.0.0--canary.461.
|
|
14
|
+
"@friggframework/schemas": "2.0.0--canary.461.086dedb.0",
|
|
15
|
+
"@friggframework/test": "2.0.0--canary.461.086dedb.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.
|
|
38
|
-
"@friggframework/prettier-config": "2.0.0--canary.461.
|
|
37
|
+
"@friggframework/eslint-config": "2.0.0--canary.461.086dedb.0",
|
|
38
|
+
"@friggframework/prettier-config": "2.0.0--canary.461.086dedb.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": "
|
|
73
|
+
"gitHead": "086dedb05c8918a9c762c273aef2481ecda7d231"
|
|
74
74
|
}
|