DockerVolumeConfiguration

class aws_cdk.aws_ecs.DockerVolumeConfiguration(*, autoprovision=None, driver, driver_opts=None, labels=None, scope)

Bases: object

The configuration for a Docker volume.

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

Parameters
  • autoprovision (Optional[bool]) – 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. Default: false

  • driver (str) – The Docker volume driver to use.

  • driver_opts (Optional[Mapping[str, str]]) – A map of Docker driver-specific options passed through. Default: No options

  • labels (Optional[Mapping[str, str]]) – Custom metadata to add to your Docker volume. Default: No labels

  • scope (Scope) – The scope for the Docker volume that determines its lifecycle.

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_ecs as ecs

docker_volume_configuration = ecs.DockerVolumeConfiguration(
    driver="driver",
    scope=ecs.Scope.TASK,

    # the properties below are optional
    autoprovision=False,
    driver_opts={
        "driver_opts_key": "driverOpts"
    },
    labels={
        "labels_key": "labels"
    }
)

Attributes

autoprovision

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.

Default

false

Return type

Optional[bool]

driver

The Docker volume driver to use.

Return type

str

driver_opts

A map of Docker driver-specific options passed through.

Default

No options

Return type

Optional[Mapping[str, str]]

labels

Custom metadata to add to your Docker volume.

Default

No labels

Return type

Optional[Mapping[str, str]]

scope

The scope for the Docker volume that determines its lifecycle.

Return type

Scope