From 0091444a65bfbf8a0f66067aea5bde0740e92444 Mon Sep 17 00:00:00 2001 From: Mark Chappell Date: Fri, 24 Sep 2021 12:10:08 +0200 Subject: [PATCH] Fix bug when allocating an EIP with in_vpc not set --- plugins/modules/ec2_eip.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/modules/ec2_eip.py b/plugins/modules/ec2_eip.py index adf6f0bda41..927d31551b7 100644 --- a/plugins/modules/ec2_eip.py +++ b/plugins/modules/ec2_eip.py @@ -344,10 +344,11 @@ def address_is_associated_with_device(ec2, module, address, device_id, is_instan def allocate_address(ec2, module, domain, reuse_existing_ip_allowed, check_mode, tag_dict=None, public_ipv4_pool=None): """ Allocate a new elastic IP address (when needed) and return it """ + if not domain: + domain = 'standard' + if reuse_existing_ip_allowed: filters = [] - if not domain: - domain = 'standard' filters.append({'Name': 'domain', "Values": [domain]}) if tag_dict is not None: