From 213fd9220032e2a9b9919eba81c648e39ff11894 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 c3a1079e5c9..61696bcfadd 100644 --- a/plugins/modules/ec2_transit_gateway.py +++ b/plugins/modules/ec2_transit_gateway.py @@ -334,7 +334,7 @@ def get_matching_tgw(self, tgw_id, description=None, skip_deleted=True): tgws.extend(response["TransitGateways"]) for gateway in response.get("TransitGateways", []): - 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 e7aeef33afaafbd3084797b81f4db743ba7b6f6b 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 00000000000..e1bfea0a101 --- /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).