diff --git a/changelogs/fragments/1650-fix-invalidinstanceid-notfound.yml b/changelogs/fragments/1650-fix-invalidinstanceid-notfound.yml new file mode 100644 index 0000000000..8953b2390a --- /dev/null +++ b/changelogs/fragments/1650-fix-invalidinstanceid-notfound.yml @@ -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). diff --git a/plugins/modules/ec2_instance.py b/plugins/modules/ec2_instance.py index a857ee58c4..0dc9b9be85 100644 --- a/plugins/modules/ec2_instance.py +++ b/plugins/modules/ec2_instance.py @@ -2165,6 +2165,7 @@ def main(): catch_extra_error_codes=[ "IncorrectState", "InsuffienctInstanceCapacity", + "InvalidInstanceID.NotFound", ] ) client = module.client("ec2", retry_decorator=retry_decorator)