Class: AWSCDK::Batch::CfnComputeEnvironment::LaunchTemplateSpecificationProperty

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

Overview

An object that represents a launch template that's associated with a compute resource.

You must specify either the launch template ID or launch template name in the request, but not both.

If security groups are specified using both the security_group_ids parameter of CreateComputeEnvironment and the launch template, the values in the security_group_ids parameter of CreateComputeEnvironment will be used.

This object isn't applicable to jobs that are running on Fargate resources.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(launch_template_id: nil, launch_template_name: nil, overrides: nil, userdata_type: nil, version: nil) ⇒ LaunchTemplateSpecificationProperty

Returns a new instance of LaunchTemplateSpecificationProperty.

Parameters:

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

    The ID of the launch template.

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

    The name of the launch template.

  • overrides (AWSCDK::IResolvable, Array<AWSCDK::IResolvable, AWSCDK::Batch::CfnComputeEnvironment::LaunchTemplateSpecificationOverrideProperty>, nil) (defaults to: nil)

    A launch template to use in place of the default launch template.

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

    The EKS node initialization process to use.

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

    The version number of the launch template, $Default , or $Latest .



1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
# File 'batch/cfn_compute_environment.rb', line 1305

def initialize(launch_template_id: nil, launch_template_name: nil, overrides: nil, userdata_type: nil, version: nil)
  @launch_template_id = launch_template_id
  Jsii::Type.check_type(@launch_template_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "launchTemplateId") unless @launch_template_id.nil?
  @launch_template_name = launch_template_name
  Jsii::Type.check_type(@launch_template_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "launchTemplateName") unless @launch_template_name.nil?
  @overrides = overrides
  Jsii::Type.check_type(@overrides, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYmF0Y2guQ2ZuQ29tcHV0ZUVudmlyb25tZW50LkxhdW5jaFRlbXBsYXRlU3BlY2lmaWNhdGlvbk92ZXJyaWRlUHJvcGVydHkifV19fSwia2luZCI6ImFycmF5In19XX19")), "overrides") unless @overrides.nil?
  @userdata_type = userdata_type
  Jsii::Type.check_type(@userdata_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "userdataType") unless @userdata_type.nil?
  @version = version
  Jsii::Type.check_type(@version, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "version") unless @version.nil?
end

Instance Attribute Details

#launch_template_idString? (readonly)

The ID of the launch template.



1322
1323
1324
# File 'batch/cfn_compute_environment.rb', line 1322

def launch_template_id
  @launch_template_id
end

#launch_template_nameString? (readonly)

The name of the launch template.



1327
1328
1329
# File 'batch/cfn_compute_environment.rb', line 1327

def launch_template_name
  @launch_template_name
end

#overridesAWSCDK::IResolvable, ... (readonly)

A launch template to use in place of the default launch template.

You must specify either the launch template ID or launch template name in the request, but not both.

You can specify up to ten (10) launch template overrides that are associated to unique instance types or families for each compute environment.

To unset all override templates for a compute environment, you can pass an empty array to the UpdateComputeEnvironment.overrides parameter, or not include the overrides parameter when submitting the UpdateComputeEnvironment API operation.



1338
1339
1340
# File 'batch/cfn_compute_environment.rb', line 1338

def overrides
  @overrides
end

#userdata_typeString? (readonly)

The EKS node initialization process to use.

You only need to specify this value if you are using a custom AMI. The default value is EKS_BOOTSTRAP_SH . If imageType is a custom AMI based on EKS_AL2023 or EKS_AL2023_NVIDIA then you must choose EKS_NODEADM .



1345
1346
1347
# File 'batch/cfn_compute_environment.rb', line 1345

def userdata_type
  @userdata_type
end

#versionString? (readonly)

The version number of the launch template, $Default , or $Latest .

If the value is $Default , the default version of the launch template is used. If the value is $Latest , the latest version of the launch template is used.

If the AMI ID that's used in a compute environment is from the launch template, the AMI isn't changed when the compute environment is updated. It's only changed if the update_to_latest_image_version parameter for the compute environment is set to true . During an infrastructure update, if either $Default or $Latest is specified, AWS Batch re-evaluates the launch template version, and it might use a different version of the launch template. This is the case even if the launch template isn't specified in the update. When updating a compute environment, changing the launch template requires an infrastructure update of the compute environment. For more information, see Updating compute environments in the AWS Batch User Guide .

Default: $Default

Latest: $Latest



1358
1359
1360
# File 'batch/cfn_compute_environment.rb', line 1358

def version
  @version
end

Class Method Details

.jsii_propertiesObject



1360
1361
1362
1363
1364
1365
1366
1367
1368
# File 'batch/cfn_compute_environment.rb', line 1360

def self.jsii_properties
  {
    :launch_template_id => "launchTemplateId",
    :launch_template_name => "launchTemplateName",
    :overrides => "overrides",
    :userdata_type => "userdataType",
    :version => "version",
  }
end

Instance Method Details

#to_jsiiObject



1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
# File 'batch/cfn_compute_environment.rb', line 1370

def to_jsii
  result = {}
  result.merge!({
    "launchTemplateId" => @launch_template_id,
    "launchTemplateName" => @launch_template_name,
    "overrides" => @overrides,
    "userdataType" => @userdata_type,
    "version" => @version,
  })
  result.compact
end