Class: AWSCDK::Batch::HostVolumeOptions

Inherits:
ECSVolumeOptions
  • Object
show all
Defined in:
batch/host_volume_options.rb

Overview

Options for configuring an ECS HostVolume.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(container_path:, name:, readonly: nil, host_path: nil) ⇒ HostVolumeOptions

Returns a new instance of HostVolumeOptions.

Parameters:

  • container_path (String)

    the path on the container where this volume is mounted.

  • name (String)

    the name of this volume.

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

    if set, the container will have readonly access to the volume.

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

    The path on the host machine this container will have access to.



11
12
13
14
15
16
17
18
19
20
# File 'batch/host_volume_options.rb', line 11

def initialize(container_path:, name:, readonly: nil, host_path: nil)
  @container_path = container_path
  Jsii::Type.check_type(@container_path, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "containerPath")
  @name = name
  Jsii::Type.check_type(@name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name")
  @readonly = readonly
  Jsii::Type.check_type(@readonly, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "readonly") unless @readonly.nil?
  @host_path = host_path
  Jsii::Type.check_type(@host_path, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "hostPath") unless @host_path.nil?
end

Instance Attribute Details

#container_pathString (readonly)

the path on the container where this volume is mounted.

Returns:

  • (String)


25
26
27
# File 'batch/host_volume_options.rb', line 25

def container_path
  @container_path
end

#host_pathString? (readonly)

Note:

Default: - Docker will choose the host path. The data may not persist after the containers that use it stop running.

The path on the host machine this container will have access to.

Returns:

  • (String, nil)


39
40
41
# File 'batch/host_volume_options.rb', line 39

def host_path
  @host_path
end

#nameString (readonly)

the name of this volume.

Returns:

  • (String)


29
30
31
# File 'batch/host_volume_options.rb', line 29

def name
  @name
end

#readonlyBoolean? (readonly)

Note:

Default: false

if set, the container will have readonly access to the volume.

Returns:

  • (Boolean, nil)


34
35
36
# File 'batch/host_volume_options.rb', line 34

def readonly
  @readonly
end

Class Method Details

.jsii_propertiesObject



41
42
43
44
45
46
47
48
# File 'batch/host_volume_options.rb', line 41

def self.jsii_properties
  {
    :container_path => "containerPath",
    :name => "name",
    :readonly => "readonly",
    :host_path => "hostPath",
  }
end

Instance Method Details

#to_jsiiObject



50
51
52
53
54
55
56
57
58
59
60
# File 'batch/host_volume_options.rb', line 50

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "containerPath" => @container_path,
    "name" => @name,
    "readonly" => @readonly,
    "hostPath" => @host_path,
  })
  result.compact
end