From c8489832e96fca892a2910996fb1bcfe06e72fa2 Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Thu, 22 Sep 2022 10:25:23 +0000 Subject: [PATCH] `ec2_instance` retry on `InsuffienctInstanceCapacity ` (#1039) (#1040) [PR #1039/0374961a backport][stable-4] `ec2_instance` retry on `InsuffienctInstanceCapacity ` This is a backport of PR #1039 as merged into main (0374961). SUMMARY Closes #1038 Expands the use of the AWSRetry decorator to include InsuffienctInstanceCapacity errors. ISSUE TYPE Feature Pull Request COMPONENT NAME ec2_instance Reviewed-by: Jill R --- changelogs/fragments/1038-ec2-insufficient-capacity.yml | 3 +++ plugins/modules/ec2_instance.py | 1 + 2 files changed, 4 insertions(+) create mode 100644 changelogs/fragments/1038-ec2-insufficient-capacity.yml diff --git a/changelogs/fragments/1038-ec2-insufficient-capacity.yml b/changelogs/fragments/1038-ec2-insufficient-capacity.yml new file mode 100644 index 00000000000..0058fe5cbb4 --- /dev/null +++ b/changelogs/fragments/1038-ec2-insufficient-capacity.yml @@ -0,0 +1,3 @@ +--- +minor_changes: + - ec2_instance - expanded the use of the automatic retries to ``InsuffienctInstanceCapacity`` (https://github.com/ansible-collections/amazon.aws/issues/1038). diff --git a/plugins/modules/ec2_instance.py b/plugins/modules/ec2_instance.py index 745d43d8959..1af800f2086 100644 --- a/plugins/modules/ec2_instance.py +++ b/plugins/modules/ec2_instance.py @@ -2072,6 +2072,7 @@ def main(): retry_decorator = AWSRetry.jittered_backoff( catch_extra_error_codes=[ 'IncorrectState', + 'InsuffienctInstanceCapacity', ] ) client = module.client('ec2', retry_decorator=retry_decorator)