# VolumeProperty

The data volume configuration for tasks launched using this task definition.

Specifying a volume configuration in a task definition is optional. The volume configuration may contain multiple volumes but only one volume configured at launch is supported. Each volume defined in the volume configuration may only specify a ``name`` and one of either ``configuredAtLaunch``, ``dockerVolumeConfiguration``, ``efsVolumeConfiguration``, ``s3filesVolumeConfiguration``, ``fsxWindowsFileServerVolumeConfiguration``, or ``host``. If an empty volume configuration is specified, by default Amazon ECS uses a host volume. For more information, see [Using data volumes in tasks](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_data_volumes.html).

- Source: Generated code
- Type last changed: v2.249.0 · 13 Apr 2026

## Example

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_ecs as ecs } from 'aws-cdk-lib';
const volumeProperty: ecs.CfnDaemonTaskDefinition.VolumeProperty = {
  host: {
    sourcePath: 'sourcePath',
  },
  name: 'name',
};
```

## Properties

- `host`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnDaemonTaskDefinition.HostVolumePropertiesProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_ecs.CfnDaemonTaskDefinition.HostVolumePropertiesProperty.html) — Details on a container instance bind mount host volume.

- `name`: string — The name of the volume.

  Up to 255 letters (uppercase and lowercase), numbers, underscores, and hyphens are allowed.
   When using a volume configured at launch, the ``name`` is required and must also be specified as the volume name in the ``ServiceVolumeConfiguration`` or ``TaskVolumeConfiguration`` parameter when creating your service or standalone task.
   For all other types of volumes, this name is referenced in the ``sourceVolume`` parameter of the ``mountPoints`` object in the container definition.
   When a volume is using the ``efsVolumeConfiguration``, the name is required.
   When a volume is using the ``s3filesVolumeConfiguration``, the name is required.
