Skip to content

Commit

Permalink
ec2_instance: add AWSRetry.jittered_backoff on client.describe_instan…
Browse files Browse the repository at this point in the history
…ce_attribute (ansible-collections#1650)

ec2_instance: add AWSRetry.jittered_backoff on client.describe_instance_attribute

SUMMARY
try to fix InvalidInstanceID.NotFound

Could not describe attribute groupSet for instance i-…: An error occurred (InvalidInstanceID.NotFound) when calling the DescribeInstanceAttribute operation: The instance ID 'i-…' does not exist

The instance actually exists, it's just an API problem.
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
ec2_instance

Reviewed-by: Helen Bailey <[email protected]>
Reviewed-by: Alina Buzachis
Reviewed-by: tchernomax
Reviewed-by: Mark Chappell
  • Loading branch information
tchernomax authored Oct 20, 2023
1 parent 0c8c3d2 commit ead8302
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions changelogs/fragments/1650-fix-invalidinstanceid-notfound.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
bugfixes:
- ec2_instance - retry API call if we get ``InvalidInstanceID.NotFound`` error (https://github.com/ansible-collections/amazon.aws/pull/1650).
1 change: 1 addition & 0 deletions plugins/modules/ec2_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -2165,6 +2165,7 @@ def main():
catch_extra_error_codes=[
"IncorrectState",
"InsuffienctInstanceCapacity",
"InvalidInstanceID.NotFound",
]
)
client = module.client("ec2", retry_decorator=retry_decorator)
Expand Down

0 comments on commit ead8302

Please sign in to comment.