Class: AWSCDK::Batch::CfnComputeEnvironment::LaunchTemplateSpecificationOverrideProperty
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::Batch::CfnComputeEnvironment::LaunchTemplateSpecificationOverrideProperty
- Defined in:
- batch/cfn_compute_environment.rb
Overview
An object that represents 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.
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.
You can define up to ten (10) overrides for each compute environment.
This object isn't applicable to jobs that are running on Fargate resources. > To unset all override templates for a compute environment, you can pass an empty array to the UpdateComputeEnvironment.overrides parameter, or not include the
overridesparameter when submitting theUpdateComputeEnvironmentAPI operation.
Instance Attribute Summary collapse
-
#launch_template_id ⇒ String?
readonly
The ID of the launch template.
-
#launch_template_name ⇒ String?
readonly
The name of the launch template.
-
#target_instance_types ⇒ Array<String>?
readonly
The instance type or family that this override launch template should be applied to.
-
#userdata_type ⇒ String?
readonly
The EKS node initialization process to use.
-
#version ⇒ String?
readonly
The version number of the launch template,
$Default, or$Latest.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(launch_template_id: nil, launch_template_name: nil, target_instance_types: nil, userdata_type: nil, version: nil) ⇒ LaunchTemplateSpecificationOverrideProperty
constructor
A new instance of LaunchTemplateSpecificationOverrideProperty.
- #to_jsii ⇒ Object
Constructor Details
#initialize(launch_template_id: nil, launch_template_name: nil, target_instance_types: nil, userdata_type: nil, version: nil) ⇒ LaunchTemplateSpecificationOverrideProperty
Returns a new instance of LaunchTemplateSpecificationOverrideProperty.
1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 |
# File 'batch/cfn_compute_environment.rb', line 1203 def initialize(launch_template_id: nil, launch_template_name: nil, target_instance_types: 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? @target_instance_types = target_instance_types Jsii::Type.check_type(@target_instance_types, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "targetInstanceTypes") unless @target_instance_types.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_id ⇒ String? (readonly)
The ID of the launch template.
Note: If you specify the launch_template_id you can't specify the launch_template_name as well.
1222 1223 1224 |
# File 'batch/cfn_compute_environment.rb', line 1222 def launch_template_id @launch_template_id end |
#launch_template_name ⇒ String? (readonly)
The name of the launch template.
Note: If you specify the launch_template_name you can't specify the launch_template_id as well.
1229 1230 1231 |
# File 'batch/cfn_compute_environment.rb', line 1229 def launch_template_name @launch_template_name end |
#target_instance_types ⇒ Array<String>? (readonly)
The instance type or family that this override launch template should be applied to.
This parameter is required when defining a launch template override.
Information included in this parameter must meet the following requirements:
- Must be a valid Amazon EC2 instance type or family.
- The following AWS Batch
InstanceTypesare not allowed:optimal,default_x86_64, anddefault_arm64. target_instance_typescan target only instance types and families that are included within theComputeResource.instanceTypesset.target_instance_typesdoesn't need to include all of the instances from theinstance_typeset, but at least a subset. For example, ifComputeResource.instanceTypesincludes[m5, g5],target_instance_typescan include[m5.2xlarge]and[m5.large]but not[c5.large].target_instance_typesincluded within the same launch template override or across launch template overrides can't overlap for the same compute environment. For example, you can't define one launch template override to target an instance family and another define an instance type within this same family.
1243 1244 1245 |
# File 'batch/cfn_compute_environment.rb', line 1243 def target_instance_types @target_instance_types end |
#userdata_type ⇒ String? (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 .
1250 1251 1252 |
# File 'batch/cfn_compute_environment.rb', line 1250 def userdata_type @userdata_type end |
#version ⇒ String? (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_versionparameter for the compute environment is set totrue. During an infrastructure update, if either$Defaultor$Latestis 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
1263 1264 1265 |
# File 'batch/cfn_compute_environment.rb', line 1263 def version @version end |
Class Method Details
.jsii_properties ⇒ Object
1265 1266 1267 1268 1269 1270 1271 1272 1273 |
# File 'batch/cfn_compute_environment.rb', line 1265 def self.jsii_properties { :launch_template_id => "launchTemplateId", :launch_template_name => "launchTemplateName", :target_instance_types => "targetInstanceTypes", :userdata_type => "userdataType", :version => "version", } end |
Instance Method Details
#to_jsii ⇒ Object
1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 |
# File 'batch/cfn_compute_environment.rb', line 1275 def to_jsii result = {} result.merge!({ "launchTemplateId" => @launch_template_id, "launchTemplateName" => @launch_template_name, "targetInstanceTypes" => @target_instance_types, "userdataType" => @userdata_type, "version" => @version, }) result.compact end |