Interpolation-only expressions are deprecated warning during terraform init

So I have been trying to explore Infrastructure as Code in my spare time and while trying out terraform I get this warning:

Warning: Interpolation-only expressions are deprecated
on main.tf line 40, in resource "vsphere_virtual_machine" "vm":
40: resource_pool_id = "${data.vsphere_resource_pool.pool.id}"

Seems like post version 0.11, resource declaration doesn’t need special syntax i.e. ${} which was not reflected in the offical documentation. So the simple solution was to let go off of the ${} expression. Since the current version is 1.19, I guess I am a late comer joining the party however equally baffled how this wrong documentation wasn’t stirring any noise!

Solution:
resource_pool_id = "data.vsphere_resource_pool.pool.id"

However, after following the latest format and trying to run terraform apply, I got an error:

Error: could not find resource pool ID "data.vsphere_resource_pool.pool.id": ServerFaultCode: The object 'vim.ResourcePool:data.vsphere_resource_pool.pool.id' has already been deleted or has not been completely created

No wonder the official documentation still had the old format in place. So, until Vmware provider implements update on their side, we have to go with the deprecated syntax.

Leave a Reply

Your email address will not be published. Required fields are marked *