def on_before_transform_resource(self, logical_id, resource_type, resource_properties):
if not self._is_supported(resource_type):<EOL><INDENT>return<EOL><DEDENT>function_policies = FunctionPolicies(resource_properties, self._policy_template_processor)<EOL>if len(function_policies) == <NUM_LIT:0>:<EOL><INDENT>return<EOL><DEDENT>result = []<EOL>for policy_entry in function_policies.get():<EOL><INDENT>if policy_entry.type is not PolicyTypes.POLICY_TEMPLATE:<EOL><INDENT>result.append(policy_entry.data)<EOL>continue<EOL><DEDENT>template_data = policy_entry.data<EOL>template_name = list(template_data.keys())[<NUM_LIT:0>]<EOL>template_parameters = list(template_data.values())[<NUM_LIT:0>]<EOL>try:<EOL><INDENT>result.append(self._policy_template_processor.convert(template_name, template_parameters))<EOL><DEDENT>except InsufficientParameterValues as ex:<EOL><INDENT>raise InvalidResourceException(logical_id, str(ex))<EOL><DEDENT>except InvalidParameterValues:<EOL><INDENT>raise InvalidResourceException(logical_id,<EOL>"<STR_LIT>"<EOL>.format(template_name))<EOL><DEDENT><DEDENT>resource_properties[FunctionPolicies.POLICIES_PROPERTY_NAME] = result<EOL>
Hook method that gets called before "each" SAM resource gets processed

:param string logical_id: Logical ID of the resource being processed
:param string resource_type: Type of the resource being processed
:param dict resource_properties: Properties of the resource
:return: Nothing