Data external runs before resource proxmox_vm_qemu

I’m not sure if his behaviour is documented, but when I try to provision virtual machines using proxmox_vm_qemu and I add an data external, it will run that data external first.

Is this because of this?

By default, Terraform will refresh all data sources before creating a plan. You can also explicitly refresh all data sources by running terraform refresh.

Or am I doing something wrong?

If I add depends_on, it seems to behave correctly.

Hi @lethargosapatheia

That is correct, data sources are designed to be evaluated as early as possible. If the data source need to depend on the creation of a managed resource, then depends_on is how you would define that dependency.

1 Like