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(",")