diff --git a/plugins/modules/ec2_transit_gateway.py b/plugins/modules/ec2_transit_gateway.py index 19876984dba..3c242126e0d 100644 --- a/plugins/modules/ec2_transit_gateway.py +++ b/plugins/modules/ec2_transit_gateway.py @@ -322,7 +322,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: