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

Make aws_instance_invalid_ami rule faster #308

Merged
merged 1 commit into from
Jun 1, 2019

Conversation

wata727
Copy link
Member

@wata727 wata727 commented May 31, 2019

Currently, aws_instance_invalid_ami rule fetches all images first. However, these are very large and take a lot of time to complete the request. We just had to provide the --fast option just to disable this rule.

In this pull request, instead of fetching all images first, it will request each time as needed, and cache the list of fetched AMIs. This can reduce the time spent on requests and significantly reduce memory usage.

The number of requests simply increases, but in many cases, it is faster than fetching all images. Here is an example of time output:

Before

tflint --deep  46.28s user 10.51s system 63% cpu 1:29.18 total

After

tflint --deep  0.55s user 0.10s system 8% cpu 7.817 total

NOTE: The --fast option will be no longer used, and will be removed in v0.9.

@wata727 wata727 merged commit 7aef739 into master Jun 1, 2019
@wata727 wata727 deleted the make_invalid_ami_rule_faster branch June 1, 2019 05:44
@wata727 wata727 mentioned this pull request Jun 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant