Convert VM to template

I have a VM on my vCenter.
I need to create a template from my VM via terraform. (Of course I do not download it. I want to create only on server.)
How can I do it?