Class: AWSCDK::Batch::HostPathVolumeOptions

Inherits:
EKSVolumeOptions
  • Object
show all
Defined in:
batch/host_path_volume_options.rb

Overview

Options for a kubernetes HostPath volume.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, mount_path: nil, readonly: nil, host_path:) ⇒ HostPathVolumeOptions

Returns a new instance of HostPathVolumeOptions.

Parameters:

  • name (String)

    The name of this volume.

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

    The path on the container where the volume is mounted.

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

    If specified, the container has readonly access to the volume.

  • host_path (String)

    The path of the file or directory on the host to mount into containers on the pod.



13
14
15
16
17
18
19
20
21
22
# File 'batch/host_path_volume_options.rb', line 13

def initialize(name:, mount_path: nil, readonly: nil, host_path:)
  @name = name
  Jsii::Type.check_type(@name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name")
  @mount_path = mount_path
  Jsii::Type.check_type(@mount_path, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "mountPath") unless @mount_path.nil?
  @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")
end

Instance Attribute Details

#host_pathString (readonly)

The path of the file or directory on the host to mount into containers on the pod.

Note: HothPath Volumes present many security risks, and should be avoided when possible.



49
50
51
# File 'batch/host_path_volume_options.rb', line 49

def host_path
  @host_path
end

#mount_pathString? (readonly)

Note:

Default: - the volume is not mounted

The path on the container where the volume is mounted.

Returns:

  • (String, nil)


35
36
37
# File 'batch/host_path_volume_options.rb', line 35

def mount_path
  @mount_path
end

#nameString (readonly)

The name of this volume.

The name must be a valid DNS subdomain name.



30
31
32
# File 'batch/host_path_volume_options.rb', line 30

def name
  @name
end

#readonlyBoolean? (readonly)

Note:

Default: false

If specified, the container has readonly access to the volume.

Otherwise, the container has read/write access.

Returns:

  • (Boolean, nil)


42
43
44
# File 'batch/host_path_volume_options.rb', line 42

def readonly
  @readonly
end

Class Method Details

.jsii_propertiesObject



51
52
53
54
55
56
57
58
# File 'batch/host_path_volume_options.rb', line 51

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

Instance Method Details

#to_jsiiObject



60
61
62
63
64
65
66
67
68
69
70
# File 'batch/host_path_volume_options.rb', line 60

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