From 4cedfe65d51f1698f1d4bd9622a701cc0f789621 Mon Sep 17 00:00:00 2001 From: Paul Czarkowski Date: Tue, 7 May 2024 16:14:44 -0400 Subject: [PATCH 1/2] fixes ec2_transit_gateway bug with empty description. sets a default description of "" --- plugins/modules/ec2_transit_gateway.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/modules/ec2_transit_gateway.py b/plugins/modules/ec2_transit_gateway.py index f2dbd118f9..23859f6234 100644 --- a/plugins/modules/ec2_transit_gateway.py +++ b/plugins/modules/ec2_transit_gateway.py @@ -306,7 +306,7 @@ def get_matching_tgw( tgws.extend(response) for gateway in response: - if description == gateway["Description"] and gateway["State"] != "deleted": + if description == gateway.get("Description", "") and gateway["State"] != "deleted": tgws.append(gateway) if len(tgws) > 1: From d921794616c620ed11fd641111c2cdc90b32f6f9 Mon Sep 17 00:00:00 2001 From: GomathiselviS Date: Mon, 23 Sep 2024 10:53:41 -0400 Subject: [PATCH 2/2] Add changelog --- changelogs/fragments/fix_tgw_description.yml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 changelogs/fragments/fix_tgw_description.yml diff --git a/changelogs/fragments/fix_tgw_description.yml b/changelogs/fragments/fix_tgw_description.yml new file mode 100644 index 0000000000..e1bfea0a10 --- /dev/null +++ b/changelogs/fragments/fix_tgw_description.yml @@ -0,0 +1,2 @@ +minor_changes: + - ec2_transit_gateway - handle empty description while deleting transit gateway (https://github.com/ansible-collections/community.aws/pull/2086).