From ead83029016663992ca163828402f59e7bb749a6 Mon Sep 17 00:00:00 2001 From: tchernomax Date: Fri, 20 Oct 2023 15:56:59 +0200 Subject: [PATCH] ec2_instance: add AWSRetry.jittered_backoff on client.describe_instance_attribute (#1650) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Alina Buzachis Reviewed-by: tchernomax Reviewed-by: Mark Chappell --- changelogs/fragments/1650-fix-invalidinstanceid-notfound.yml | 3 +++ plugins/modules/ec2_instance.py | 1 + 2 files changed, 4 insertions(+) create mode 100644 changelogs/fragments/1650-fix-invalidinstanceid-notfound.yml diff --git a/changelogs/fragments/1650-fix-invalidinstanceid-notfound.yml b/changelogs/fragments/1650-fix-invalidinstanceid-notfound.yml new file mode 100644 index 00000000000..8953b2390a1 --- /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 a857ee58c4f..0dc9b9be856 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)