def _construct_version(self, function, intrinsics_resolver):
code_dict = function.Code<EOL>if not code_dict:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>if not intrinsics_resolver:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>code_dict = intrinsics_resolver.resolve_parameter_refs(code_dict)<EOL>prefix = "<STR_LIT>".format(id=self.logical_id)<EOL>logical_id = logical_id_generator.LogicalIdGenerator(prefix, code_dict).gen()<EOL>attributes = self.get_passthrough_resource_attributes()<EOL>if attributes is None:<EOL><INDENT>attributes = {}<EOL><DEDENT>attributes["<STR_LIT>"] = "<STR_LIT>"<EOL>lambda_version = LambdaVersion(logical_id=logical_id, attributes=attributes)<EOL>lambda_version.FunctionName = function.get_runtime_attr('<STR_LIT:name>')<EOL>lambda_version.Description = self.VersionDescription<EOL>return lambda_version<EOL>
Constructs a Lambda Version resource that will be auto-published when CodeUri of the function changes.
        Old versions will not be deleted without a direct reference from the CloudFormation template.

        :param model.lambda_.LambdaFunction function: Lambda function object that is being connected to a version
        :param model.intrinsics.resolver.IntrinsicsResolver intrinsics_resolver: Class that can help resolve
            references to parameters present in CodeUri. It is a common usecase to set S3Key of Code to be a
            template parameter. Need to resolve the values otherwise we will never detect a change in Code dict
        :return: Lambda function Version resource