Skip to content

Commit ccded39

Browse files
authored
Modify Benchmark flows to allow partial results from some AWS actions (#2233)
Fixes OPS-4128 and OPS-4154 ## Additional Notes Updating flows allowing partial results from AWS actions: - Idle RDS instances.json - Orphaned RDS Snapshots.json - Unattached EBS.json - EBS Generation upgrade (gp2 to gp3).json - Underutilized EC2.json - Underutilized RDS.json Other generic update (exported from PG2 and updated by Pawel): - Idle Compute Optimizer Recommendations.json
1 parent 5aa8013 commit ccded39

7 files changed

Lines changed: 432 additions & 504 deletions

packages/server/api/src/app/benchmark/workflows-catalog/aws/AWS Benchmark - EBS Generation upgrade (gp2 to gp3).json

Lines changed: 188 additions & 242 deletions
Large diffs are not rendered by default.

packages/server/api/src/app/benchmark/workflows-catalog/aws/AWS Benchmark - Idle Compute Optimizer Recommendations.json

Lines changed: 113 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"created": "1775630008688",
3-
"updated": "1775630008688",
2+
"created": "1776417484381",
3+
"updated": "1776417484381",
44
"name": "AWS Benchmark - Idle Compute Optimizer Recommendations",
55
"tags": [],
66
"services": [],
@@ -131,7 +131,7 @@
131131
}
132132
},
133133
"displayName": "Return Response",
134-
"stepIndex": 12
134+
"stepIndex": 13
135135
},
136136
"displayName": "ACCOUNT",
137137
"firstLoopAction": {
@@ -273,103 +273,131 @@
273273
}
274274
},
275275
"nextAction": {
276-
"id": "0KqyHzXl5yo5yGPzyyByJ",
277-
"name": "step_b",
278-
"type": "BLOCK",
276+
"id": "XDTXpt9uCfEqoLD8VCzZj",
277+
"name": "step_c",
278+
"type": "CODE",
279279
"valid": true,
280280
"settings": {
281281
"input": {
282-
"tableName": "Opportunities",
283-
"rowPrimaryKey": {
284-
"rowPrimaryKey": null
285-
},
286-
"fieldsProperties": {
287-
"fieldsProperties": [
288-
{
289-
"fieldName": "Status",
290-
"newFieldValue": {
291-
"newFieldValue": "Created"
292-
}
293-
},
294-
{
295-
"fieldName": "Estimated savings USD per month",
296-
"newFieldValue": {
297-
"newFieldValue": "{{step_d['item']['savingsOpportunity']['estimatedMonthlySavings']['value']}}"
298-
}
299-
},
300-
{
301-
"fieldName": "Workflow",
302-
"newFieldValue": {
303-
"newFieldValue": "{{step_26}}"
304-
}
305-
},
306-
{
307-
"fieldName": "Resource Id",
308-
"newFieldValue": {
309-
"newFieldValue": "{{step_d['item']['resourceArn']}}"
310-
}
311-
},
312-
{
313-
"fieldName": "Account",
314-
"newFieldValue": {
315-
"newFieldValue": "{{step_1['item']}}"
316-
}
317-
},
318-
{
319-
"fieldName": "Region",
320-
"newFieldValue": {
321-
"newFieldValue": "{{step_32['item']}}"
322-
}
323-
},
324-
{
325-
"fieldName": "Service",
326-
"newFieldValue": {
327-
"newFieldValue": "{{step_d['item']['resourceType']}}"
328-
}
329-
},
330-
{
331-
"fieldName": "Opportunity generator",
332-
"newFieldValue": {
333-
"newFieldValue": "AWS Compute Optimizer"
334-
}
335-
},
336-
{
337-
"fieldName": "Opportunity Type",
338-
"newFieldValue": {
339-
"newFieldValue": "Workflow optimization"
340-
}
341-
},
342-
{
343-
"fieldName": "Opportunity details",
344-
"newFieldValue": {
345-
"newFieldValue": "{{step_d['item']['findingDescription']}}"
346-
}
347-
}
348-
]
349-
},
350-
"roundToFieldPrecision": true
282+
"type": "{{step_d['item']['resourceType']}}"
283+
},
284+
"sourceCode": {
285+
"code": "export const code = async ({type}) => {\n\n if(type == \"EBSVolume\") {\n return \"AWS EBS\";\n }\n if(type == \"RDSDBInstance\") {\n return \"AWS RDS\";\n }\n if(type == \"EC2Instance\") {\n return \"AWS EC2\";\n }\n \n return type;\n};",
286+
"packageJson": "{}"
351287
},
352-
"blockName": "@openops/block-openops-tables",
353-
"blockType": "OFFICIAL",
354-
"pieceName": "@openops/piece-openops-tables",
355-
"pieceType": "OFFICIAL",
356-
"actionName": "update_record",
357288
"inputUiInfo": {
358289
"customizedInputs": {}
359290
},
360-
"packageType": "REGISTRY",
361-
"blockVersion": "0.0.1",
362-
"pieceVersion": "~0.0.1",
363291
"errorHandlingOptions": {
364292
"retryOnFailure": {
365293
"value": false
366294
},
367295
"continueOnFailure": {
368-
"value": true
296+
"value": false
369297
}
370298
}
371299
},
372-
"displayName": "Create OpenOps opportunity",
300+
"nextAction": {
301+
"id": "0KqyHzXl5yo5yGPzyyByJ",
302+
"name": "step_b",
303+
"type": "BLOCK",
304+
"valid": true,
305+
"settings": {
306+
"input": {
307+
"tableName": "Opportunities",
308+
"rowPrimaryKey": {
309+
"rowPrimaryKey": null
310+
},
311+
"fieldsProperties": {
312+
"fieldsProperties": [
313+
{
314+
"fieldName": "Status",
315+
"newFieldValue": {
316+
"newFieldValue": "Created"
317+
}
318+
},
319+
{
320+
"fieldName": "Estimated savings USD per month",
321+
"newFieldValue": {
322+
"newFieldValue": "{{step_d['item']['savingsOpportunity']['estimatedMonthlySavings']['value']}}"
323+
}
324+
},
325+
{
326+
"fieldName": "Workflow",
327+
"newFieldValue": {
328+
"newFieldValue": "{{step_26}}"
329+
}
330+
},
331+
{
332+
"fieldName": "Resource Id",
333+
"newFieldValue": {
334+
"newFieldValue": "{{step_d['item']['resourceArn']}}"
335+
}
336+
},
337+
{
338+
"fieldName": "Account",
339+
"newFieldValue": {
340+
"newFieldValue": "{{step_1['item']}}"
341+
}
342+
},
343+
{
344+
"fieldName": "Region",
345+
"newFieldValue": {
346+
"newFieldValue": "{{step_32['item']}}"
347+
}
348+
},
349+
{
350+
"fieldName": "Service",
351+
"newFieldValue": {
352+
"newFieldValue": "{{step_c}}"
353+
}
354+
},
355+
{
356+
"fieldName": "Opportunity generator",
357+
"newFieldValue": {
358+
"newFieldValue": "AWS Compute Optimizer"
359+
}
360+
},
361+
{
362+
"fieldName": "Opportunity Type",
363+
"newFieldValue": {
364+
"newFieldValue": "Workflow optimization"
365+
}
366+
},
367+
{
368+
"fieldName": "Opportunity details",
369+
"newFieldValue": {
370+
"newFieldValue": "{{step_d['item']['findingDescription']}}"
371+
}
372+
}
373+
]
374+
},
375+
"roundToFieldPrecision": true
376+
},
377+
"blockName": "@openops/block-openops-tables",
378+
"blockType": "OFFICIAL",
379+
"pieceName": "@openops/piece-openops-tables",
380+
"pieceType": "OFFICIAL",
381+
"actionName": "update_record",
382+
"inputUiInfo": {
383+
"customizedInputs": {}
384+
},
385+
"packageType": "REGISTRY",
386+
"blockVersion": "0.0.1",
387+
"pieceVersion": "~0.0.1",
388+
"errorHandlingOptions": {
389+
"retryOnFailure": {
390+
"value": false
391+
},
392+
"continueOnFailure": {
393+
"value": true
394+
}
395+
}
396+
},
397+
"displayName": "Create OpenOps opportunity",
398+
"stepIndex": 12
399+
},
400+
"displayName": "Resource Service Name",
373401
"stepIndex": 11
374402
},
375403
"displayName": "Opportunity doesn't exist or snooze expired",

packages/server/api/src/app/benchmark/workflows-catalog/aws/AWS Benchmark - Idle RDS instances.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@
102102
"domainIds": [],
103103
"clusterIds": [],
104104
"filterByARNs": false,
105+
"allowPartialResults": true,
105106
"filterProperty": {
106107
"regions": "{{step_c['regions']}}"
107108
}
@@ -114,6 +115,7 @@
114115
"settings": {
115116
"input": {
116117
"auth": true,
118+
"allowPartialResults": true,
117119
"accounts": {
118120
"accounts": true
119121
},
@@ -203,7 +205,7 @@
203205
"type": "LOOP_ON_ITEMS",
204206
"valid": true,
205207
"settings": {
206-
"items": "{{step_1}}",
208+
"items": "{{step_1['results']}}",
207209
"inputUiInfo": {
208210
"customizedInputs": {}
209211
}

packages/server/api/src/app/benchmark/workflows-catalog/aws/AWS Benchmark - Orphaned RDS Snapshots.json

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@
9494
"domainIds": [],
9595
"clusterIds": [],
9696
"filterByARNs": false,
97+
"allowPartialResults": true,
9798
"filterProperty": {
9899
"regions": "{{step_b['regions']}}"
99100
}
@@ -106,6 +107,7 @@
106107
"settings": {
107108
"input": {
108109
"auth": true,
110+
"allowPartialResults": true,
109111
"accounts": {
110112
"accounts": true
111113
},
@@ -143,6 +145,7 @@
143145
"instanceIds": [],
144146
"filterByARNs": false,
145147
"snapshotType": [],
148+
"allowPartialResults": true,
146149
"filterProperty": {
147150
"regions": "{{step_b['regions']}}"
148151
},
@@ -159,6 +162,7 @@
159162
"settings": {
160163
"input": {
161164
"auth": true,
165+
"allowPartialResults": true,
162166
"accounts": {
163167
"accounts": true
164168
},
@@ -189,7 +193,7 @@
189193
"settings": {
190194
"input": {
191195
"keyName": "DBInstanceIdentifier",
192-
"listItems": "{{step_2}}"
196+
"listItems": "{{step_2['results']}}"
193197
},
194198
"blockName": "@openops/block-list-operations",
195199
"blockType": "OFFICIAL",
@@ -253,7 +257,7 @@
253257
"type": "LOOP_ON_ITEMS",
254258
"valid": true,
255259
"settings": {
256-
"items": "{{step_1}}",
260+
"items": "{{step_1['results']}}",
257261
"inputUiInfo": {
258262
"customizedInputs": {}
259263
}
@@ -631,9 +635,7 @@
631635
"endDate": "{{step_15}}",
632636
"startDate": "{{step_8[0].EventTime}}",
633637
"endDateFormat": "YYYY-MM-DDTHH:mm:ss",
634-
"unitDifference": [
635-
"day"
636-
],
638+
"unitDifference": ["day"],
637639
"startDateFormat": "YYYY-MM-DDTHH:mm:ss"
638640
},
639641
"blockName": "@openops/block-date-helper",
@@ -786,4 +788,4 @@
786788
"@openops/block-http"
787789
],
788790
"categories": []
789-
}
791+
}

packages/server/api/src/app/benchmark/workflows-catalog/aws/AWS Benchmark - Unattached EBS.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@
127127
"filterProperty": {
128128
"regions": "{{step_b['regions']}}"
129129
},
130+
"allowPartialResults": true,
130131
"shouldQueryOnlyUnattached": true
131132
},
132133
"blockName": "@openops/block-aws",
@@ -139,6 +140,7 @@
139140
"settings": {
140141
"input": {
141142
"auth": true,
143+
"allowPartialResults": true,
142144
"accounts": {
143145
"accounts": true
144146
},
@@ -167,7 +169,7 @@
167169
"type": "LOOP_ON_ITEMS",
168170
"valid": true,
169171
"settings": {
170-
"items": "{{step_1}}",
172+
"items": "{{step_1['results']}}",
171173
"inputUiInfo": {
172174
"customizedInputs": {}
173175
}

0 commit comments

Comments
 (0)