terraform-provider-truenas icon indicating copy to clipboard operation
terraform-provider-truenas copied to clipboard

How to use resource truenas_dataset for nested DS were levels > 2

Open nrvale0 opened this issue 4 months ago • 0 comments

Howdy. Curious if you can provide an example of how one might specify DataSet nesting > 2 using the truenas_dataset resource?

This works great for <= 2:

resource "truenas_dataset" "Sync" {
  pool = "<redacted>"
  name = "Sync"
  compression = "off"
  sync = "inherit"
  atime = "off"
  deduplication = "off"
  readonly = "off"
}

resource "truenas_dataset" "Media" {
  pool = "<redacted>"
  parent = "Sync"
  name = "Media"
  compression = "off"
  sync = "inherit"
  atime = "off"
  deduplication = "off"
  readonly = "off"
  depends_on = [
    truenas_dataset.Sync
  ]
}

However, things get a little less clear once you do deeper. For example: //Sync/Media/Movies:

resource "truenas_dataset" "Movies" {
  pool = "<redacted>"
  parent = "Media" # <- What should go here? ex: '/<pool>/Sync'?
  name = "Movies"
  compression = "off"
  sync = "inherit"
  atime = "off"
  deduplication = "off"
  readonly = "off"
  depends_on = [
    truenas_dataset.Media # <- What about here?
  ]
}

Thanks for any insight you can share.

nrvale0 avatar Apr 01 '24 23:04 nrvale0