elastic / cloudbeat

Analyzing Cloud Security Posture
Other
38 stars 43 forks source link

extend standard retry with 429 http status code #2223

Closed orouz closed 1 month ago

orouz commented 1 month ago

Summary of your changes

this PR:

  1. adds a Standard Retryer
    • it seems that initializing AWS config via libbeat's InitializeAWSConfig function ends up returning an aws.Config with Retryer as nil, so without adding it we're not opting-in to the default retry mechanism
  2. adds 429 as an additional, retryable HTTP status code.

Implementation notes

the first commit of this PR can be considered an alternative, standalone implementation of doing the same thing the 2nd commit does. the difference between the two, is that the 2nd commit removes the ConfigProvider in favor of a plain function to encapsulate AWS config initialization (via libbeat) + adding a retryer. to do so, some code was removed and now all AWS config initializations call the same function, and the only consumer of the now-deleted AWS config provider (EKS) sets the region manually (which is what the provider did)

all in all - the 2nd commit's diff is bigger, but i think it does some nice cleanup too. although, we could go with the 1st if preferable.

Related Issues

Checklist

mergify[bot] commented 1 month ago

This pull request does not have a backport label. Could you fix it @orouz? 🙏 To fixup this pull request, you need to add the backport labels for the needed branches, such as:

github-actions[bot] commented 1 month ago

:bar_chart: Allure Report - :green_heart: No failures were reported.

Result Count
🟥 Failed 0
🟩 Passed 359
⬜ Skipped 33