Skip to content
v2.273.0

DockerVolumeConfiguration Struct ​

The configuration for a Docker volume.

Docker volumes are only supported when you are using the EC2 launch type.

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 dockerVolumeConfiguration: ecs.DockerVolumeConfiguration = {
  driver: 'driver',
  scope: ecs.Scope.TASK,

  // the properties below are optional
  autoprovision: false,
  driverOpts: {
    driverOptsKey: 'driverOpts',
  },
  labels: {
    labelsKey: 'labels',
  },
};

Properties ​

autoprovisionbooleanautoprovisionboolautoprovisionBooleanAutoprovisionboolAutoprovision*bool= false#
Specifies whether the Docker volume should be created if it does not already exist.

If true is specified, the Docker volume will be created for you.

driverstringdriverstrdriverStringDriverstringDriver*stringrequired#
The Docker volume driver to use.
driverOpts{ [key: string]: string }driver_optstyping.Mapping[str, str]driverOptsMap<String, String>DriverOptsIDictionary<string, string>DriverOpts*map[string]*string= No options#
A map of Docker driver-specific options passed through.
labels{ [key: string]: string }labelstyping.Mapping[str, str]labelsMap<String, String>LabelsIDictionary<string, string>Labels*map[string]*string= No labels#
Custom metadata to add to your Docker volume.
scopeScopescopeScopescopeScopeScopeScopeScopeScoperequired#
The scope for the Docker volume that determines its lifecycle.