diff --git a/plugins/modules/elb_target_group.py b/plugins/modules/elb_target_group.py index f9849264200..721f40738b4 100644 --- a/plugins/modules/elb_target_group.py +++ b/plugins/modules/elb_target_group.py @@ -682,7 +682,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(',')