# Scope

The scope for the Docker volume that determines its lifecycle.

Docker volumes that are scoped to a task are automatically provisioned when the task starts and destroyed when the task stops.
Docker volumes that are scoped as shared persist after the task stops.

- Source: [`aws-ecs/lib/base/task-definition.ts`](https://github.com/aws/aws-cdk/blob/v2.274.0/packages/aws-cdk-lib/aws-ecs/lib/base/task-definition.ts#L1351)

## Members

| Member | Description |
| --- | --- |
| `TASK` | Docker volumes that are scoped to a task are automatically provisioned when the task starts and destroyed when the task stops. |
| `SHARED` | Docker volumes that are scoped as shared persist after the task stops. |

## Referenced by

- [`DockerVolumeConfiguration`](/v2/docs/aws-cdk-lib.aws_ecs.DockerVolumeConfiguration).scope
