aws-samples / aws-health-aware

AHA is an incident management & communication framework to provide real-time alert customers when there are active AWS event(s). For customers with AWS Organizations, customers can get aggregated active account level events of all the accounts in the Organization. Customers not using AWS Organizations still benefit alerting at the account level.
MIT No Attribution
348 stars 143 forks source link

Correct the lookup of the health endpoint to avoid caching when the lambda is warm. #17

Open grahamhar opened 3 years ago

grahamhar commented 3 years ago

This is an attempt to fix the issue reported in issue: https://github.com/aws-samples/aws-health-aware/issues/16

Description of changes:

Setting the boto config via a lookup done at the global level of file means that a change in the active region would not be picked up if the lambda was warm. I've added test cases as I prefer to work on code with tests, feel free to remove them if prefer.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.