Skip to content

Volumes and Mounts

Volumes are specified at the task level. The recommended place to specify all your volumes is within the task_defaults block. Any volumes that are not referenced within a task's containers will be ignored and not included in the task definition. This means you can specify all possible volumes within the task defaults and just reference them in various containers using mount points.

Example Usage

task_defaults:
  volumes:
    - name: archive
      efs:
        file_system_id: fs-1234567
        access_point_id: fsap-abc12345

  mounts:
    - path: /mnt/archive
      source: archive
task_defaults:
  volumes:
    - name: bindvol
    - other-bind-vol # short hand

  mounts:
    - path: /mnt/shared
      source: bindvol

    - path: /mnt/roshared
      source: other-bind-vol
      readonly: true

Specifying Volumes

Volumes are specified as an array of objects with the following fields:

name - (required)

The name of the volume.

efs

Adding this block marks this as an EFS Volume reference.

See EFS Volumes below for details.

EFS Volumes

file_system_id - (required)

The ID of the EFS file system you want to reference.

access_point_id - (recommended)

The EFS Access Point ID. This is the recommended way of using an EFS volume.

root

The directory within the EFS file system to mount as the root directory inside the host.

Do not specify this if you are using an AccessPoint.

disable_iam

Disable using the task's role when mounting the EFS Volume.

Default: false

disable_encryption

Disable encryption for data in transit. Encryption is required if you use IAM or access_point_id are set.

You should leave encryption enabled, always. There's no good reason to disable encryption.

Default: false

Specifying Mount Points

Mounts specified at the task level will be applied to the primary container only. If you need to use a mount in a sidecar container, you will need to specify it within the sidecar object.

path - (required)

The path inside the container where this volume will be mounted.

source - (required)

The name of the volume that this mount references.

Must match the name used when declaring the volume.

readonly

Whether to mount the volume as read-only.

Default: false

See Also