{"id":231,"date":"2020-06-22T06:31:01","date_gmt":"2020-06-22T06:31:01","guid":{"rendered":"http:\/\/shresthabrijan.com.np\/?p=231"},"modified":"2020-06-22T10:36:58","modified_gmt":"2020-06-22T10:36:58","slug":"interpolation-only-expressions-are-deprecated-warning-during-terraform-init","status":"publish","type":"post","link":"https:\/\/shresthabrijan.com.np\/?p=231","title":{"rendered":"Interpolation-only expressions are deprecated warning during terraform init"},"content":{"rendered":"\n<p>So I have been trying to explore Infrastructure as Code in my spare time and while trying out terraform I get this warning:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Warning: Interpolation-only expressions are deprecated\non main.tf line 40, in resource \"vsphere_virtual_machine\" \"vm\":\n40: resource_pool_id = \"${data.vsphere_resource_pool.pool.id}\"<\/pre>\n\n\n\n<p>Seems like post version 0.11, resource declaration doesn\u2019t 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\u2019t stirring any noise!<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Solution:\nresource_pool_id = \"data.vsphere_resource_pool.pool.id\"<\/pre>\n\n\n\n<p>  However, after following the latest format and trying to run <em>terraform apply,<\/em> I got an error:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">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<\/pre>\n\n\n\n<p>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.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 &#8220;vsphere_virtual_machine&#8221; &#8220;vm&#8221;: 40: resource_pool_id = &#8220;${data.vsphere_resource_pool.pool.id}&#8221; Seems like post version 0.11, resource declaration doesn\u2019t need special syntax i.e. ${} which was [&hellip;]<\/p>\n<div class=\"read-more\"><a href=\"https:\/\/shresthabrijan.com.np\/?p=231\" class=\"btn btn-primary btn-lg\">Read More<\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[12,11],"class_list":["post-231","post","type-post","status-publish","format-standard","hentry","category-system-administration","tag-iac","tag-terrraform"],"_links":{"self":[{"href":"https:\/\/shresthabrijan.com.np\/index.php?rest_route=\/wp\/v2\/posts\/231","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/shresthabrijan.com.np\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/shresthabrijan.com.np\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/shresthabrijan.com.np\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/shresthabrijan.com.np\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=231"}],"version-history":[{"count":5,"href":"https:\/\/shresthabrijan.com.np\/index.php?rest_route=\/wp\/v2\/posts\/231\/revisions"}],"predecessor-version":[{"id":236,"href":"https:\/\/shresthabrijan.com.np\/index.php?rest_route=\/wp\/v2\/posts\/231\/revisions\/236"}],"wp:attachment":[{"href":"https:\/\/shresthabrijan.com.np\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=231"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/shresthabrijan.com.np\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=231"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/shresthabrijan.com.np\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=231"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}