Class: AWSCDK::ECS::DockerVolumeConfiguration

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

Overview

The configuration for a Docker volume.

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of DockerVolumeConfiguration.

Parameters:

  • driver (String)

    The Docker volume driver to use.

  • scope (AWSCDK::ECS::Scope)

    The scope for the Docker volume that determines its lifecycle.

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

    Specifies whether the Docker volume should be created if it does not already exist.

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

    A map of Docker driver-specific options passed through.

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

    Custom metadata to add to your Docker volume.



14
15
16
17
18
19
20
21
22
23
24
25
# File 'ecs/docker_volume_configuration.rb', line 14

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

Instance Attribute Details

#autoprovisionBoolean? (readonly)

Note:

Default: 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.

Returns:

  • (Boolean, nil)


41
42
43
# File 'ecs/docker_volume_configuration.rb', line 41

def autoprovision
  @autoprovision
end

#driverString (readonly)

The Docker volume driver to use.

Returns:

  • (String)


30
31
32
# File 'ecs/docker_volume_configuration.rb', line 30

def driver
  @driver
end

#driver_optsHash{String => String}? (readonly)

Note:

Default: No options

A map of Docker driver-specific options passed through.

Returns:

  • (Hash{String => String}, nil)


46
47
48
# File 'ecs/docker_volume_configuration.rb', line 46

def driver_opts
  @driver_opts
end

#labelsHash{String => String}? (readonly)

Note:

Default: No labels

Custom metadata to add to your Docker volume.

Returns:

  • (Hash{String => String}, nil)


51
52
53
# File 'ecs/docker_volume_configuration.rb', line 51

def labels
  @labels
end

#scopeAWSCDK::ECS::Scope (readonly)

The scope for the Docker volume that determines its lifecycle.

Returns:



34
35
36
# File 'ecs/docker_volume_configuration.rb', line 34

def scope
  @scope
end

Class Method Details

.jsii_propertiesObject



53
54
55
56
57
58
59
60
61
# File 'ecs/docker_volume_configuration.rb', line 53

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

Instance Method Details

#to_jsiiObject



63
64
65
66
67
68
69
70
71
72
73
# File 'ecs/docker_volume_configuration.rb', line 63

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