def _update_logical_id_hash(self, resources):
output_resources = resources.get("<STR_LIT>", {})<EOL>deployment_logical_id_dict = {}<EOL>rest_api_to_swagger_hash = {}<EOL>dict_of_things_to_delete = {}<EOL>for logical_id, resource_dict in output_resources.items():<EOL><INDENT>if "<STR_LIT>" == resource_dict.get("<STR_LIT>"):<EOL><INDENT>resource_properties = resource_dict.get("<STR_LIT>", {})<EOL>if "<STR_LIT>" in resource_properties:<EOL><INDENT>self._generate_new_deployment_hash(logical_id, resource_properties.get("<STR_LIT>"), rest_api_to_swagger_hash)<EOL><DEDENT>elif "<STR_LIT>" in resource_dict.get("<STR_LIT>"):<EOL><INDENT>self._generate_new_deployment_hash(logical_id,<EOL>resource_properties.get("<STR_LIT>"),<EOL>rest_api_to_swagger_hash)<EOL><DEDENT><DEDENT><DEDENT>for logical_id, resource_dict in output_resources.items():<EOL><INDENT>if "<STR_LIT>" == resource_dict.get("<STR_LIT>"):<EOL><INDENT>resource_properties = resource_dict.get("<STR_LIT>", {})<EOL>rest_id = resource_properties.get("<STR_LIT>").get("<STR_LIT>")<EOL>data_hash = rest_api_to_swagger_hash.get(rest_id)<EOL>description = resource_properties.get("<STR_LIT>")[:-len(data_hash)]<EOL>resource_properties["<STR_LIT>"] = description + data_hash<EOL>new_logical_id = logical_id[:-<NUM_LIT:10>] + data_hash[:<NUM_LIT:10>]<EOL>deployment_logical_id_dict[logical_id] = new_logical_id<EOL>dict_of_things_to_delete[logical_id] = (new_logical_id, resource_dict)<EOL><DEDENT><DEDENT>for logical_id, resource_dict in output_resources.items():<EOL><INDENT>if "<STR_LIT>" == resource_dict.get("<STR_LIT>"):<EOL><INDENT>resource_properties = resource_dict.get("<STR_LIT>", {})<EOL>rest_id = resource_properties.get("<STR_LIT>", {}).get("<STR_LIT>", "<STR_LIT>")<EOL>data_hash = rest_api_to_swagger_hash.get(rest_id)<EOL>deployment_id = resource_properties.get("<STR_LIT>", {}).get("<STR_LIT>")<EOL>new_logical_id = deployment_logical_id_dict.get(deployment_id, "<STR_LIT>")[:-<NUM_LIT:10>]<EOL>new_logical_id = new_logical_id + data_hash[:<NUM_LIT:10>]<EOL>resource_properties.get("<STR_LIT>", {})["<STR_LIT>"] = new_logical_id<EOL><DEDENT><DEDENT>for logical_id_to_remove, tuple_to_add in dict_of_things_to_delete.items():<EOL><INDENT>output_resources[tuple_to_add[<NUM_LIT:0>]] = tuple_to_add[<NUM_LIT:1>]<EOL>del output_resources[logical_id_to_remove]<EOL><DEDENT>for output_key, output_value in resources.get("<STR_LIT>", {}).items():<EOL><INDENT>if output_value.get("<STR_LIT>") in deployment_logical_id_dict:<EOL><INDENT>output_value["<STR_LIT>"] = deployment_logical_id_dict[output_value.get("<STR_LIT>")]<EOL><DEDENT><DEDENT>
Brute force method for updating all APIGW Deployment LogicalIds and references to a consistent hash