From d3dc8daa9af2d83313159c38b88a4c82da5f0092 Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Fri, 20 Oct 2023 16:39:05 +0000 Subject: [PATCH] ec2_instance: add AWSRetry.jittered_backoff on client.describe_instance_attribute (#1650) (#1817) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [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 --- 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 eb3dbad6465..d8a86dd7151 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)