The problem was solved by include the generation block with required version. Within the block, the file was given the name version_override.tf, causing terraform to override the main file version.tf.
version_override.tf
version.tf