Modify EC2 Get Instances action to allow partial results#2216
Modify EC2 Get Instances action to allow partial results#2216ravikiranvm wants to merge 7 commits intomainfrom
EC2 Get Instances action to allow partial results#2216Conversation
There was a problem hiding this comment.
Pull request overview
This PR (OPS-4065) updates the EC2 “Get Instances” implementation to optionally tolerate per-region failures and still return results from successful regions, enabling workflows to proceed with partial data.
Changes:
- Added
getEc2InstancesWithPartialResultshelper that returns{ results, failedRegions }usingPromise.allSettledacross regions. - Added
allowPartialResultscheckbox to the EC2 Get Instances block action to switch between strict vs partial-result behavior. - Added/updated unit tests covering partial results behavior and action output shape.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/openops/src/lib/aws/ec2/ec2-get-instances.ts | Introduces partial-results helper/types and refactors per-region describe logic into a shared function. |
| packages/openops/test/aws/ec2/ec2-get-instances.test.ts | Adds unit tests validating partial-results behavior and STS failure handling. |
| packages/blocks/aws/src/lib/actions/ec2/ec2-get-instances-action.ts | Adds allowPartialResults prop, routes to partial helper, and refactors batching logic. |
| packages/blocks/aws/test/ec2/ec2-get-instances-action.test.ts | Extends action tests for the new prop and partial-results return shape/aggregation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| fetchFilters: Filter[]; | ||
| }; | ||
|
|
||
| function buildEc2GetInstancesBatches( |
There was a problem hiding this comment.
Moved the common logic here to remove duplication between the partial-results and strict branches. This function builds the list of EC2 describe batches
|



Part of OPS-4065.
I will modify the remaining AWS Actions in the follow-up PRs.
Additional Notes