Class: AWSCDK::ECS::CfnTaskDefinition::DockerVolumeConfigurationProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
ecs/cfn_task_definition.rb

Overview

The DockerVolumeConfiguration property specifies a Docker volume configuration and is used when you use Docker volumes.

Docker volumes are only supported when you are using the EC2 launch type. Windows containers only support the use of the local driver. To use bind mounts, specify a host instead.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(autoprovision: nil, driver: nil, driver_opts: nil, labels: nil, scope: nil) ⇒ DockerVolumeConfigurationProperty

Returns a new instance of DockerVolumeConfigurationProperty.

Parameters:

  • autoprovision (Boolean, AWSCDK::IResolvable, nil) (defaults to: nil)

    If this value is true , the Docker volume is created if it doesn't already exist.

  • driver (String, nil) (defaults to: nil)

    The Docker volume driver to use.

  • driver_opts (AWSCDK::IResolvable, Hash{String => String}, nil) (defaults to: nil)

    A map of Docker driver-specific options passed through.

  • labels (AWSCDK::IResolvable, Hash{String => String}, nil) (defaults to: nil)

    Custom metadata to add to your Docker volume.

  • scope (String, nil) (defaults to: nil)

    The scope for the Docker volume that determines its lifecycle.



1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
# File 'ecs/cfn_task_definition.rb', line 1584

def initialize(autoprovision: nil, driver: nil, driver_opts: nil, labels: nil, scope: nil)
  @autoprovision = autoprovision
  Jsii::Type.check_type(@autoprovision, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "autoprovision") unless @autoprovision.nil?
  @driver = driver
  Jsii::Type.check_type(@driver, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "driver") unless @driver.nil?
  @driver_opts = driver_opts
  Jsii::Type.check_type(@driver_opts, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsicHJpbWl0aXZlIjoic3RyaW5nIn0sImtpbmQiOiJtYXAifX1dfX0=")), "driverOpts") unless @driver_opts.nil?
  @labels = labels
  Jsii::Type.check_type(@labels, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsicHJpbWl0aXZlIjoic3RyaW5nIn0sImtpbmQiOiJtYXAifX1dfX0=")), "labels") unless @labels.nil?
  @scope = scope
  Jsii::Type.check_type(@scope, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "scope") unless @scope.nil?
end

Instance Attribute Details

#autoprovisionBoolean, ... (readonly)

If this value is true , the Docker volume is created if it doesn't already exist.

This field is only used if the scope is shared .



1603
1604
1605
# File 'ecs/cfn_task_definition.rb', line 1603

def autoprovision
  @autoprovision
end

#driverString? (readonly)

The Docker volume driver to use.

The driver value must match the driver name provided by Docker because it is used for task placement. If the driver was installed using the Docker plugin CLI, use docker plugin ls to retrieve the driver name from your container instance. If the driver was installed using another method, use Docker plugin discovery to retrieve the driver name. This parameter maps to Driver in the docker container create command and the xxdriver option to docker volume create.



1610
1611
1612
# File 'ecs/cfn_task_definition.rb', line 1610

def driver
  @driver
end

#driver_optsAWSCDK::IResolvable, ... (readonly)

A map of Docker driver-specific options passed through.

This parameter maps to DriverOpts in the docker create-volume command and the xxopt option to docker volume create.



1617
1618
1619
# File 'ecs/cfn_task_definition.rb', line 1617

def driver_opts
  @driver_opts
end

#labelsAWSCDK::IResolvable, ... (readonly)

Custom metadata to add to your Docker volume.

This parameter maps to Labels in the docker container create command and the xxlabel option to docker volume create.



1624
1625
1626
# File 'ecs/cfn_task_definition.rb', line 1624

def labels
  @labels
end

#scopeString? (readonly)

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.



1631
1632
1633
# File 'ecs/cfn_task_definition.rb', line 1631

def scope
  @scope
end

Class Method Details

.jsii_propertiesObject



1633
1634
1635
1636
1637
1638
1639
1640
1641
# File 'ecs/cfn_task_definition.rb', line 1633

def self.jsii_properties
  {
    :autoprovision => "autoprovision",
    :driver => "driver",
    :driver_opts => "driverOpts",
    :labels => "labels",
    :scope => "scope",
  }
end

Instance Method Details

#to_jsiiObject



1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
# File 'ecs/cfn_task_definition.rb', line 1643

def to_jsii
  result = {}
  result.merge!({
    "autoprovision" => @autoprovision,
    "driver" => @driver,
    "driverOpts" => @driver_opts,
    "labels" => @labels,
    "scope" => @scope,
  })
  result.compact
end