Class: AWSCDK::Batch::EFSVolumeOptions

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

Overview

Options for configuring an EfsVolume.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(container_path:, name:, readonly: nil, file_system:, access_point_id: nil, enable_transit_encryption: nil, root_directory: nil, transit_encryption_port: nil, use_job_role: nil) ⇒ EFSVolumeOptions

Returns a new instance of EFSVolumeOptions.

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.

  • file_system (AWSCDK::Interfaces::AWSEFS::IFileSystemRef)

    The EFS File System that supports this volume.

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

    The Amazon EFS access point ID to use.

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

    Enables encryption for Amazon EFS data in transit between the Amazon ECS host and the Amazon EFS server.

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

    The directory within the Amazon EFS file system to mount as the root directory inside the host.

  • transit_encryption_port (Numeric, nil) (defaults to: nil)

    The port to use when sending encrypted data between the Amazon ECS host and the Amazon EFS server.

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

    Whether or not to use the AWS Batch job IAM role defined in a job definition when mounting the Amazon EFS file system.



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'batch/efs_volume_options.rb', line 16

def initialize(container_path:, name:, readonly: nil, file_system:, access_point_id: nil, enable_transit_encryption: nil, root_directory: nil, transit_encryption_port: nil, use_job_role: 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?
  @file_system = file_system
  Jsii::Type.check_type(@file_system, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19lZnMuSUZpbGVTeXN0ZW1SZWYifQ==")), "fileSystem")
  @access_point_id = access_point_id
  Jsii::Type.check_type(@access_point_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "accessPointId") unless @access_point_id.nil?
  @enable_transit_encryption = enable_transit_encryption
  Jsii::Type.check_type(@enable_transit_encryption, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "enableTransitEncryption") unless @enable_transit_encryption.nil?
  @root_directory = root_directory
  Jsii::Type.check_type(@root_directory, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "rootDirectory") unless @root_directory.nil?
  @transit_encryption_port = transit_encryption_port
  Jsii::Type.check_type(@transit_encryption_port, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "transitEncryptionPort") unless @transit_encryption_port.nil?
  @use_job_role = use_job_role
  Jsii::Type.check_type(@use_job_role, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "useJobRole") unless @use_job_role.nil?
end

Instance Attribute Details

#access_point_idString? (readonly)

Note:

Default: - no accessPointId

The Amazon EFS access point ID to use.

If an access point is specified, root_directory must either be omitted or set to / which enforces the path set on the EFS access point. If an access point is used, enable_transit_encryption must be true.



63
64
65
# File 'batch/efs_volume_options.rb', line 63

def access_point_id
  @access_point_id
end

#container_pathString (readonly)

the path on the container where this volume is mounted.

Returns:

  • (String)


40
41
42
# File 'batch/efs_volume_options.rb', line 40

def container_path
  @container_path
end

#enable_transit_encryptionBoolean? (readonly)

Note:

Default: false

Enables encryption for Amazon EFS data in transit between the Amazon ECS host and the Amazon EFS server.



69
70
71
# File 'batch/efs_volume_options.rb', line 69

def enable_transit_encryption
  @enable_transit_encryption
end

#file_systemAWSCDK::Interfaces::AWSEFS::IFileSystemRef (readonly)

The EFS File System that supports this volume.



53
54
55
# File 'batch/efs_volume_options.rb', line 53

def file_system
  @file_system
end

#nameString (readonly)

the name of this volume.

Returns:

  • (String)


44
45
46
# File 'batch/efs_volume_options.rb', line 44

def name
  @name
end

#readonlyBoolean? (readonly)

Note:

Default: false

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

Returns:

  • (Boolean, nil)


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

def readonly
  @readonly
end

#root_directoryString? (readonly)

Note:

Default: - root of the EFS File System

The directory within the Amazon EFS file system to mount as the root directory inside the host.

If this parameter is omitted, the root of the Amazon EFS volume is used instead. Specifying / has the same effect as omitting this parameter. The maximum length is 4,096 characters.

Returns:

  • (String, nil)


78
79
80
# File 'batch/efs_volume_options.rb', line 78

def root_directory
  @root_directory
end

#transit_encryption_portNumeric? (readonly)

Note:

Default: - chosen by the EFS Mount Helper

The port to use when sending encrypted data between the Amazon ECS host and the Amazon EFS server.

The value must be between 0 and 65,535.



86
87
88
# File 'batch/efs_volume_options.rb', line 86

def transit_encryption_port
  @transit_encryption_port
end

#use_job_roleBoolean? (readonly)

Note:

Default: false

Whether or not to use the AWS Batch job IAM role defined in a job definition when mounting the Amazon EFS file system.

If specified, enable_transit_encryption must be true.



94
95
96
# File 'batch/efs_volume_options.rb', line 94

def use_job_role
  @use_job_role
end

Class Method Details

.jsii_propertiesObject



96
97
98
99
100
101
102
103
104
105
106
107
108
# File 'batch/efs_volume_options.rb', line 96

def self.jsii_properties
  {
    :container_path => "containerPath",
    :name => "name",
    :readonly => "readonly",
    :file_system => "fileSystem",
    :access_point_id => "accessPointId",
    :enable_transit_encryption => "enableTransitEncryption",
    :root_directory => "rootDirectory",
    :transit_encryption_port => "transitEncryptionPort",
    :use_job_role => "useJobRole",
  }
end

Instance Method Details

#to_jsiiObject



110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# File 'batch/efs_volume_options.rb', line 110

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "containerPath" => @container_path,
    "name" => @name,
    "readonly" => @readonly,
    "fileSystem" => @file_system,
    "accessPointId" => @access_point_id,
    "enableTransitEncryption" => @enable_transit_encryption,
    "rootDirectory" => @root_directory,
    "transitEncryptionPort" => @transit_encryption_port,
    "useJobRole" => @use_job_role,
  })
  result.compact
end