1636 long aws check#1919
Conversation
ilija-lazoroski
left a comment
There was a problem hiding this comment.
Good job! Just make sure it is tested on actual AWS instance.
mssalvatore
left a comment
There was a problem hiding this comment.
Just a few small suggestions.
Codecov Report
@@ Coverage Diff @@
## develop #1919 +/- ##
===========================================
- Coverage 55.43% 55.37% -0.07%
===========================================
Files 449 448 -1
Lines 12816 12927 +111
===========================================
+ Hits 7105 7158 +53
- Misses 5711 5769 +58
Continue to review full report at Codecov.
|
mssalvatore
left a comment
There was a problem hiding this comment.
Given the complications that have arisen, I think an overall better approach is provide a function called get_aws_info() -> AWSInfo where AWSInfo is a named tuple or dataclass. We can use @lru_cache to cache the results of get_aws_info() to prevent the slow calls from being made more than once.
See the comments for more detail.
Singleton is a common pattern, potentially usable in the Agent so it belongs in common
AWS related services call AWS metadata service which might take a long time to timeout, that's why they are ran on a separate thread
Locks will avoid the situation where is_running_on_aws is called before this service finished initializing
Update the IAM role change screenshot and add a note about firewall rules
This change simplifies the codebase by removing unnecessary inheritance and nested directory structure
This also changes AwsInstance from singleton and instead the aws_service package is used as one
501827a to
e895897
Compare
What does this PR do?
Fixes #1636
Add any further explanations here.
PR Checklist
Testing Checklist