From 49dbb8946ce82c2fe4e702938c6597170e3379be Mon Sep 17 00:00:00 2001 From: Marco Braga Date: Tue, 2 May 2023 20:18:32 -0300 Subject: [PATCH] fix/elbv2-tg: KeyError when getting ProtocolVersion --- plugins/modules/elb_target_group.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/modules/elb_target_group.py b/plugins/modules/elb_target_group.py index bbab1507d2d..93a3f333df6 100644 --- a/plugins/modules/elb_target_group.py +++ b/plugins/modules/elb_target_group.py @@ -719,7 +719,7 @@ def create_or_update_target_group(connection, module): # TODO: required and here? if "Matcher" in params: code_key = "HttpCode" - if target_group["ProtocolVersion"] == "GRPC": + if target_group.get("ProtocolVersion") == "GRPC": code_key = "GrpcCode" current_matcher_list = target_group["Matcher"][code_key].split(",") requested_matcher_list = params["Matcher"][code_key].split(",")