Class: AWSCDK::Batch::ECSMachineImage

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

Overview

A Batch MachineImage that is compatible with ECS.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(image: nil, image_type: nil) ⇒ ECSMachineImage

Returns a new instance of ECSMachineImage.

Parameters:



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

def initialize(image: nil, image_type: nil)
  @image = image
  Jsii::Type.check_type(@image, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLklNYWNoaW5lSW1hZ2UifQ==")), "image") unless @image.nil?
  @image_type = image_type
  Jsii::Type.check_type(@image_type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYmF0Y2guRWNzTWFjaGluZUltYWdlVHlwZSJ9")), "imageType") unless @image_type.nil?
end

Instance Attribute Details

#imageAWSCDK::EC2::IMachineImage? (readonly)

Note:

Default: - chosen by batch

The machine image to use.

Returns:



20
21
22
# File 'batch/ecs_machine_image.rb', line 20

def image
  @image
end

#image_typeAWSCDK::Batch::ECSMachineImageType? (readonly)

Note:

Default: - 'ECS_AL2' for non-gpu instances, 'ECS_AL2_NVIDIA' for gpu instances. If the '@aws-cdk/aws-batch:defaultToAL2023' feature flag is set, 'ECS_AL2023' will be used instead of 'ECS_AL2'.

Tells Batch which instance type to launch this image on.



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

def image_type
  @image_type
end

Class Method Details

.jsii_propertiesObject



27
28
29
30
31
32
# File 'batch/ecs_machine_image.rb', line 27

def self.jsii_properties
  {
    :image => "image",
    :image_type => "imageType",
  }
end

Instance Method Details

#to_jsiiObject



34
35
36
37
38
39
40
41
# File 'batch/ecs_machine_image.rb', line 34

def to_jsii
  result = {}
  result.merge!({
    "image" => @image,
    "imageType" => @image_type,
  })
  result.compact
end