Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Improve ec2 discovery: do not fetch instances twice, use tags to filter #4666

Merged
merged 4 commits into from
Sep 19, 2024

Conversation

preslavgerchev
Copy link
Contributor

@preslavgerchev preslavgerchev commented Sep 18, 2024

  • use passed in tags as filters
  • use passed in instance ids as filters

…lter out instances during DescribeInstances.

Signed-off-by: Preslav <preslav@mondoo.com>
@@ -911,7 +872,7 @@ func (a *mqlAwsEc2) gatherInstanceInfo(instances []ec2types.Reservation, imdsvVe
"ebsOptimized": llx.BoolDataPtr(instance.EbsOptimized),
"enaSupported": llx.BoolDataPtr(instance.EnaSupport),
"httpEndpoint": llx.StringData(string(instance.MetadataOptions.HttpEndpoint)),
"httpTokens": llx.StringData(httpTokens),
"httpTokens": llx.StringData(string(instance.MetadataOptions.HttpTokens)),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is why we were doing it twice, it's now returned as a response

Copy link
Contributor

github-actions bot commented Sep 18, 2024

Test Results

3 099 tests  ±0   3 098 ✅ ±0   1m 22s ⏱️ -7s
  370 suites ±0       1 💤 ±0 
   28 files   ±0       0 ❌ ±0 

Results for commit 2751514. ± Comparison against base commit 3dbfee7.

♻️ This comment has been updated with latest results.

Signed-off-by: Preslav <preslav@mondoo.com>
Signed-off-by: Preslav <preslav@mondoo.com>
Signed-off-by: Preslav <preslav@mondoo.com>
@preslavgerchev preslavgerchev merged commit 14b1750 into main Sep 19, 2024
15 checks passed
@preslavgerchev preslavgerchev deleted the preslav/better-ec2-discovery branch September 19, 2024 14:04
@github-actions github-actions bot locked and limited conversation to collaborators Sep 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants