About converting "darwin_64" to "linux_64"


I manage gcp all infrastructure with Terraform. At first I forgot while working and init over macos. Plugins were installed according to “darwin_amd64”.

But I must to convert it to “linux_amd64”.

I put all my “.tf” files on a linux for testing purposes. I deleted the “.terraform.tfstate” and “.terraform” files. I did “terraform init” again.

Whenever I run the “terraform plan” command it automatically tries to rebuild the entire infrastructure. But then he says that there is such a source and he gives an error. The same happens when I try copying my old “terraform.tfstate” file.

I need to convert these terraform files to work on linux. I don’t want to delete the all infrastructure and re-init on a linux server. Is there a way to do this ?

Trying to rebuild the entire infrastructure sounds like the resources aren’t in state. terraform init should be safe to use without touching the state file–it should make sure you have the requisite providers for your operating system.

This probably is a better question for the Terraform forum, however, as it’s not about provider development.