github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/e2e/csi/input/use-efs-volume-read.nomad (about)

     1  # a job that mounts the EFS volume and sleeps, so that we can
     2  # read its mounted file system remotely
     3  job "use-efs-volume" {
     4    datacenters = ["dc1"]
     5  
     6    constraint {
     7      attribute = "${attr.kernel.name}"
     8      value     = "linux"
     9    }
    10  
    11    group "group" {
    12  
    13      volume "test" {
    14        type            = "csi"
    15        source          = "efs-vol0"
    16        attachment_mode = "file-system"
    17        access_mode     = "single-node-writer"
    18      }
    19  
    20      task "task" {
    21        driver = "docker"
    22  
    23        config {
    24          image   = "busybox:1"
    25          command = "/bin/sh"
    26          args    = ["-c", "sleep 3600"]
    27        }
    28  
    29        volume_mount {
    30          volume      = "test"
    31          destination = "${NOMAD_TASK_DIR}/test"
    32          read_only   = true
    33        }
    34  
    35        resources {
    36          cpu    = 500
    37          memory = 128
    38        }
    39      }
    40    }
    41  }