cloudfront_invalidation - Do not fetch every cloudfront invalidation when caller_reference is None #234
Labels
affects_2.10
feature
This issue/PR relates to a feature request
module
module
plugins
plugin (any type)
SUMMARY
When requesting
cloudfront_invalidation
the module is firstly trying to fetch every existing/passedinvalidation
to determine if theinvalidation
has not already be done based oncaller_reference
as keyhttps://github.com/ansible-collections/community.aws/blob/main/plugins/modules/cloudfront_invalidation.py#L161
However, when you've cloudfront that containing large number of executed
invalidation
,cloudfront_invalidation
will take really long time to compute. In our case with time it takes more than 10 minutes...Since we're not passing
caller_reference
param, and regarding code:https://github.com/ansible-collections/community.aws/blob/main/plugins/modules/cloudfront_invalidation.py#L235
It will generate a pseudo-unique one using current timestamp. I think is not really useful to check the existing/passed
invalidation
ISSUE TYPE
COMPONENT NAME
cloudfront_invalidation
ADDITIONAL INFORMATION
I'm ok to PR but I'll need some feedbacks!
Example of what patched I've applied locally (is a bit dirty but give the idea)
I've moved from ~10mins to 3secs with patch
The text was updated successfully, but these errors were encountered: