<p>I want to create a persistent volume using Terraform, like this:</p>

<pre><code>...
persistent_volume_source {
    nfs {
        path = "/${data.azurerm_netapp_volume.my_netapp_volume.volume_path}"
        server = data.azurerm_netapp_volume.my_netapp_volume.volume_path
    }
}
...
</code></pre>

<p>The Azure Netapp Volume already exists. The problem is that my mount path looks like <code>1.2.3.4:/my-netapp-volume</code> and the terraform plan ends up with something like this:</p>

<pre><code>          + persistent_volume_source {

              + nfs {
                  + path   = "/my-netapp-volume"
                  + server = "my-netapp-volume"
                }
            }
</code></pre>

<p>Is it possible to somehow get the 1.2.3.4 part of my path? </p>

Daniel
<p>As it shows, the server property of the Kubernetes persistent volume should be set the value with an IP address of the NetApp volume. But you set the with its path. </p>

<p>So what you need to is to find the IP address of the NetApp volume. I suggest you output all the information of your NetApp volume by adding the code like this:</p>

<pre><code>output "netapp-volume" {
  value = data.azurerm_netapp_volume.my_netapp_volume
}
</code></pre>

<p>If it shows the IP address in the mount targets, then you can put it as the server value. If it does not show it, then you can only set the server value with the IP address of the NetApp volume manually. To get it, you can use the Azure CLI command <a href="https://learn.microsoft.com/en-us/cli/azure/netappfiles/volume?view=azure-cli-latest#az-netappfiles-volume-show" rel="nofollow noreferrer"><code>az netappfiles volume show</code></a>.</p>
