I have a Terraform module for configuring Google Cloud instances that used to just configure Linux hosts, but now I need to setup a Windows host. The issue with that is that I can’t use provisioner
block for that because it doesn’t support RDP or anything else that Windows could use.
The google_compute_instance
resource allows for setting of metadata.sysprep-specialize-script-ps1
to provide a PowerShell script for setup. But if I do that the provisioner used for Linux hosts still tries to run and fails with a timeout due to lack of SSH.
Is there a way to make the provisioner
block optional depending on a variable?
I saw there’s a when
clause, but it seems like the only valid values are create
and destroy
.