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 (#1650) (#1817)

[PR #1650/ead83029 backport][stable-6] ec2_instance: add AWSRetry.jittered_backoff on client.describe_instance_attribute

This is a backport of PR #1650 as merged into main (ead8302).
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: Alina Buzachis
  • Loading branch information
patchback[bot] authored Oct 20, 2023
1 parent ccb0af5 commit d3dc8da
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 d3dc8da

Please sign in to comment.