Example terraform to use persistent_volume_claim in kubernetes_deployment_v1 resource

Hello,

I am looking for a terraform example to use persistent_volume_claim on kubernetes_deployment_v1 resource,
as per Terraform Registry

my current terraform as below,

resource “kubernetes_deployment_v1” “example” {
metadata {
name = “deployment-name”
namespace = “deployment-namespace”
labels = {
app.kubernetes.io/name” = “deployment-name”
}
}
spec {
replicas = 1
selector {
match_labels = {
app.kubernetes.io/name” = “deployment-name”
}
}
template {
metadata {
labels = {
app.kubernetes.io/name” = “deployment-name”
}
}
spec {
image_pull_secrets {
name = “image-pull-secret”
}
container {
image = “container-path”
name = “container-name”
}
}
}
}
}

I was able to make it work with below.

  volume_mount {
          mount_path        = "PATH"
          mount_propagation = "None"
          name              = "VOLUMENAME"
          read_only         = false
    }

  volume {
          name = "VOLUMENAME"
          persistent_volume_claim {
             claim_name = "PVCNAME"
           }
  }