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: