Class: AWSCDK::Batch::ECSVolume

Inherits:
Jsii::Object
  • Object
show all
Defined in:
batch/ecs_volume.rb

Overview

Represents a Volume that can be mounted to a container that uses ECS.

Direct Known Subclasses

EFSVolume, HostVolume

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ ECSVolume

Returns a new instance of ECSVolume.

Parameters:



9
10
11
12
13
# File 'batch/ecs_volume.rb', line 9

def initialize(options)
  options = options.is_a?(Hash) ? ::AWSCDK::Batch::ECSVolumeOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYmF0Y2guRWNzVm9sdW1lT3B0aW9ucyJ9")), "options")
  Jsii::Object.instance_method(:initialize).bind(self).call(options)
end

Class Method Details

.efs(options) ⇒ AWSCDK::Batch::EFSVolume

Creates a Volume that uses an AWS Elastic File System (EFS);

this volume can grow and shrink as needed



30
31
32
33
34
# File 'batch/ecs_volume.rb', line 30

def self.efs(options)
  options = options.is_a?(Hash) ? ::AWSCDK::Batch::EFSVolumeOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYmF0Y2guRWZzVm9sdW1lT3B0aW9ucyJ9")), "options")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_batch.EcsVolume", "efs", [options])
end

.host(options) ⇒ AWSCDK::Batch::HostVolume

Creates a Host volume.

This volume will persist on the host at the specified host_path. If the host_path is not specified, Docker will choose the host path. In this case, the data may not persist after the containers that use it stop running.



44
45
46
47
48
# File 'batch/ecs_volume.rb', line 44

def self.host(options)
  options = options.is_a?(Hash) ? ::AWSCDK::Batch::HostVolumeOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYmF0Y2guSG9zdFZvbHVtZU9wdGlvbnMifQ==")), "options")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_batch.EcsVolume", "host", [options])
end

.jsii_overridable_methodsObject



15
16
17
18
19
20
21
# File 'batch/ecs_volume.rb', line 15

def self.jsii_overridable_methods
  {
    :container_path => { kind: :property, name: "containerPath", is_optional: false },
    :name => { kind: :property, name: "name", is_optional: false },
    :readonly => { kind: :property, name: "readonly", is_optional: true },
  }
end

Instance Method Details

#container_pathString

The path on the container that this volume will be mounted to.

Returns:

  • (String)


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

def container_path()
  jsii_get_property("containerPath")
end

#nameString

The name of this volume.

Returns:

  • (String)


60
61
62
# File 'batch/ecs_volume.rb', line 60

def name()
  jsii_get_property("name")
end

#readonlyBoolean?

Note:

Default: false

Whether or not the container has readonly access to this volume.

Returns:

  • (Boolean, nil)


68
69
70
# File 'batch/ecs_volume.rb', line 68

def readonly()
  jsii_get_property("readonly")
end