BEst way to copy files to a new Virtual machine

What is the best way to copy files to a new cloud virtual machine?

I was recently working with a new infrastructure, where I should configure a NGINX server. To complete the configuration in terraform , i need to copy some files to this VM.

What is the recommended way to do this and where can i find documentation about it?

I already tried:
File provisioner
Cloud init