Class: AWSCDK::EC2::CfnLaunchTemplate::LaunchTemplateDataProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
ec2/cfn_launch_template.rb

Overview

The information to include in the launch template.

You must specify at least one parameter for the launch template data.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(block_device_mappings: nil, capacity_reservation_specification: nil, cpu_options: nil, credit_specification: nil, disable_api_stop: nil, disable_api_termination: nil, ebs_optimized: nil, elastic_gpu_specifications: nil, elastic_inference_accelerators: nil, enclave_options: nil, hibernation_options: nil, iam_instance_profile: nil, image_id: nil, instance_initiated_shutdown_behavior: nil, instance_market_options: nil, instance_requirements: nil, instance_type: nil, kernel_id: nil, key_name: nil, license_specifications: nil, maintenance_options: nil, metadata_options: nil, monitoring: nil, network_interfaces: nil, network_performance_options: nil, placement: nil, private_dns_name_options: nil, ram_disk_id: nil, security_group_ids: nil, security_groups: nil, tag_specifications: nil, user_data: nil) ⇒ LaunchTemplateDataProperty

Returns a new instance of LaunchTemplateDataProperty.

Parameters:



2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
# File 'ec2/cfn_launch_template.rb', line 2166

def initialize(block_device_mappings: nil, capacity_reservation_specification: nil, cpu_options: nil, credit_specification: nil, disable_api_stop: nil, disable_api_termination: nil, ebs_optimized: nil, elastic_gpu_specifications: nil, elastic_inference_accelerators: nil, enclave_options: nil, hibernation_options: nil, iam_instance_profile: nil, image_id: nil, instance_initiated_shutdown_behavior: nil, instance_market_options: nil, instance_requirements: nil, instance_type: nil, kernel_id: nil, key_name: nil, license_specifications: nil, maintenance_options: nil, metadata_options: nil, monitoring: nil, network_interfaces: nil, network_performance_options: nil, placement: nil, private_dns_name_options: nil, ram_disk_id: nil, security_group_ids: nil, security_groups: nil, tag_specifications: nil, user_data: nil)
  @block_device_mappings = block_device_mappings
  Jsii::Type.check_type(@block_device_mappings, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLkNmbkxhdW5jaFRlbXBsYXRlLkJsb2NrRGV2aWNlTWFwcGluZ1Byb3BlcnR5In1dfX0sImtpbmQiOiJhcnJheSJ9fV19fQ==")), "blockDeviceMappings") unless @block_device_mappings.nil?
  @capacity_reservation_specification = capacity_reservation_specification.is_a?(Hash) ? ::AWSCDK::EC2::CfnLaunchTemplate::CapacityReservationSpecificationProperty.new(**capacity_reservation_specification.transform_keys(&:to_sym)) : capacity_reservation_specification
  Jsii::Type.check_type(@capacity_reservation_specification, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuQ2ZuTGF1bmNoVGVtcGxhdGUuQ2FwYWNpdHlSZXNlcnZhdGlvblNwZWNpZmljYXRpb25Qcm9wZXJ0eSJ9XX19")), "capacityReservationSpecification") unless @capacity_reservation_specification.nil?
  @cpu_options = cpu_options.is_a?(Hash) ? ::AWSCDK::EC2::CfnLaunchTemplate::CpuOptionsProperty.new(**cpu_options.transform_keys(&:to_sym)) : cpu_options
  Jsii::Type.check_type(@cpu_options, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuQ2ZuTGF1bmNoVGVtcGxhdGUuQ3B1T3B0aW9uc1Byb3BlcnR5In1dfX0=")), "cpuOptions") unless @cpu_options.nil?
  @credit_specification = credit_specification.is_a?(Hash) ? ::AWSCDK::EC2::CfnLaunchTemplate::CreditSpecificationProperty.new(**credit_specification.transform_keys(&:to_sym)) : credit_specification
  Jsii::Type.check_type(@credit_specification, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuQ2ZuTGF1bmNoVGVtcGxhdGUuQ3JlZGl0U3BlY2lmaWNhdGlvblByb3BlcnR5In1dfX0=")), "creditSpecification") unless @credit_specification.nil?
  @disable_api_stop = disable_api_stop
  Jsii::Type.check_type(@disable_api_stop, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "disableApiStop") unless @disable_api_stop.nil?
  @disable_api_termination = disable_api_termination
  Jsii::Type.check_type(@disable_api_termination, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "disableApiTermination") unless @disable_api_termination.nil?
  @ebs_optimized = ebs_optimized
  Jsii::Type.check_type(@ebs_optimized, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "ebsOptimized") unless @ebs_optimized.nil?
  @elastic_gpu_specifications = elastic_gpu_specifications
  Jsii::Type.check_type(@elastic_gpu_specifications, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLkNmbkxhdW5jaFRlbXBsYXRlLkVsYXN0aWNHcHVTcGVjaWZpY2F0aW9uUHJvcGVydHkifV19fSwia2luZCI6ImFycmF5In19XX19")), "elasticGpuSpecifications") unless @elastic_gpu_specifications.nil?
  @elastic_inference_accelerators = elastic_inference_accelerators
  Jsii::Type.check_type(@elastic_inference_accelerators, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLkNmbkxhdW5jaFRlbXBsYXRlLkxhdW5jaFRlbXBsYXRlRWxhc3RpY0luZmVyZW5jZUFjY2VsZXJhdG9yUHJvcGVydHkifV19fSwia2luZCI6ImFycmF5In19XX19")), "elasticInferenceAccelerators") unless @elastic_inference_accelerators.nil?
  @enclave_options = enclave_options.is_a?(Hash) ? ::AWSCDK::EC2::CfnLaunchTemplate::EnclaveOptionsProperty.new(**enclave_options.transform_keys(&:to_sym)) : enclave_options
  Jsii::Type.check_type(@enclave_options, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuQ2ZuTGF1bmNoVGVtcGxhdGUuRW5jbGF2ZU9wdGlvbnNQcm9wZXJ0eSJ9XX19")), "enclaveOptions") unless @enclave_options.nil?
  @hibernation_options = hibernation_options.is_a?(Hash) ? ::AWSCDK::EC2::CfnLaunchTemplate::HibernationOptionsProperty.new(**hibernation_options.transform_keys(&:to_sym)) : hibernation_options
  Jsii::Type.check_type(@hibernation_options, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuQ2ZuTGF1bmNoVGVtcGxhdGUuSGliZXJuYXRpb25PcHRpb25zUHJvcGVydHkifV19fQ==")), "hibernationOptions") unless @hibernation_options.nil?
  @iam_instance_profile = iam_instance_profile.is_a?(Hash) ? ::AWSCDK::EC2::CfnLaunchTemplate::IAMInstanceProfileProperty.new(**iam_instance_profile.transform_keys(&:to_sym)) : iam_instance_profile
  Jsii::Type.check_type(@iam_instance_profile, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuQ2ZuTGF1bmNoVGVtcGxhdGUuSWFtSW5zdGFuY2VQcm9maWxlUHJvcGVydHkifV19fQ==")), "iamInstanceProfile") unless @iam_instance_profile.nil?
  @image_id = image_id
  Jsii::Type.check_type(@image_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "imageId") unless @image_id.nil?
  @instance_initiated_shutdown_behavior = instance_initiated_shutdown_behavior
  Jsii::Type.check_type(@instance_initiated_shutdown_behavior, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "instanceInitiatedShutdownBehavior") unless @instance_initiated_shutdown_behavior.nil?
  @instance_market_options = instance_market_options.is_a?(Hash) ? ::AWSCDK::EC2::CfnLaunchTemplate::InstanceMarketOptionsProperty.new(**instance_market_options.transform_keys(&:to_sym)) : instance_market_options
  Jsii::Type.check_type(@instance_market_options, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuQ2ZuTGF1bmNoVGVtcGxhdGUuSW5zdGFuY2VNYXJrZXRPcHRpb25zUHJvcGVydHkifV19fQ==")), "instanceMarketOptions") unless @instance_market_options.nil?
  @instance_requirements = instance_requirements.is_a?(Hash) ? ::AWSCDK::EC2::CfnLaunchTemplate::InstanceRequirementsProperty.new(**instance_requirements.transform_keys(&:to_sym)) : instance_requirements
  Jsii::Type.check_type(@instance_requirements, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuQ2ZuTGF1bmNoVGVtcGxhdGUuSW5zdGFuY2VSZXF1aXJlbWVudHNQcm9wZXJ0eSJ9XX19")), "instanceRequirements") unless @instance_requirements.nil?
  @instance_type = instance_type
  Jsii::Type.check_type(@instance_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "instanceType") unless @instance_type.nil?
  @kernel_id = kernel_id
  Jsii::Type.check_type(@kernel_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "kernelId") unless @kernel_id.nil?
  @key_name = key_name
  Jsii::Type.check_type(@key_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "keyName") unless @key_name.nil?
  @license_specifications = license_specifications
  Jsii::Type.check_type(@license_specifications, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLkNmbkxhdW5jaFRlbXBsYXRlLkxpY2Vuc2VTcGVjaWZpY2F0aW9uUHJvcGVydHkifV19fSwia2luZCI6ImFycmF5In19XX19")), "licenseSpecifications") unless @license_specifications.nil?
  @maintenance_options = maintenance_options.is_a?(Hash) ? ::AWSCDK::EC2::CfnLaunchTemplate::MaintenanceOptionsProperty.new(**maintenance_options.transform_keys(&:to_sym)) : maintenance_options
  Jsii::Type.check_type(@maintenance_options, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuQ2ZuTGF1bmNoVGVtcGxhdGUuTWFpbnRlbmFuY2VPcHRpb25zUHJvcGVydHkifV19fQ==")), "maintenanceOptions") unless @maintenance_options.nil?
  @metadata_options = .is_a?(Hash) ? ::AWSCDK::EC2::CfnLaunchTemplate::MetadataOptionsProperty.new(**.transform_keys(&:to_sym)) : 
  Jsii::Type.check_type(@metadata_options, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuQ2ZuTGF1bmNoVGVtcGxhdGUuTWV0YWRhdGFPcHRpb25zUHJvcGVydHkifV19fQ==")), "metadataOptions") unless @metadata_options.nil?
  @monitoring = monitoring.is_a?(Hash) ? ::AWSCDK::EC2::CfnLaunchTemplate::MonitoringProperty.new(**monitoring.transform_keys(&:to_sym)) : monitoring
  Jsii::Type.check_type(@monitoring, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuQ2ZuTGF1bmNoVGVtcGxhdGUuTW9uaXRvcmluZ1Byb3BlcnR5In1dfX0=")), "monitoring") unless @monitoring.nil?
  @network_interfaces = network_interfaces
  Jsii::Type.check_type(@network_interfaces, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLkNmbkxhdW5jaFRlbXBsYXRlLk5ldHdvcmtJbnRlcmZhY2VQcm9wZXJ0eSJ9XX19LCJraW5kIjoiYXJyYXkifX1dfX0=")), "networkInterfaces") unless @network_interfaces.nil?
  @network_performance_options = network_performance_options.is_a?(Hash) ? ::AWSCDK::EC2::CfnLaunchTemplate::NetworkPerformanceOptionsProperty.new(**network_performance_options.transform_keys(&:to_sym)) : network_performance_options
  Jsii::Type.check_type(@network_performance_options, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuQ2ZuTGF1bmNoVGVtcGxhdGUuTmV0d29ya1BlcmZvcm1hbmNlT3B0aW9uc1Byb3BlcnR5In1dfX0=")), "networkPerformanceOptions") unless @network_performance_options.nil?
  @placement = placement.is_a?(Hash) ? ::AWSCDK::EC2::CfnLaunchTemplate::PlacementProperty.new(**placement.transform_keys(&:to_sym)) : placement
  Jsii::Type.check_type(@placement, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuQ2ZuTGF1bmNoVGVtcGxhdGUuUGxhY2VtZW50UHJvcGVydHkifV19fQ==")), "placement") unless @placement.nil?
  @private_dns_name_options = private_dns_name_options.is_a?(Hash) ? ::AWSCDK::EC2::CfnLaunchTemplate::PrivateDNSNameOptionsProperty.new(**private_dns_name_options.transform_keys(&:to_sym)) : private_dns_name_options
  Jsii::Type.check_type(@private_dns_name_options, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuQ2ZuTGF1bmNoVGVtcGxhdGUuUHJpdmF0ZURuc05hbWVPcHRpb25zUHJvcGVydHkifV19fQ==")), "privateDnsNameOptions") unless @private_dns_name_options.nil?
  @ram_disk_id = ram_disk_id
  Jsii::Type.check_type(@ram_disk_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "ramDiskId") unless @ram_disk_id.nil?
  @security_group_ids = security_group_ids
  Jsii::Type.check_type(@security_group_ids, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "securityGroupIds") unless @security_group_ids.nil?
  @security_groups = security_groups
  Jsii::Type.check_type(@security_groups, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "securityGroups") unless @security_groups.nil?
  @tag_specifications = tag_specifications
  Jsii::Type.check_type(@tag_specifications, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLkNmbkxhdW5jaFRlbXBsYXRlLlRhZ1NwZWNpZmljYXRpb25Qcm9wZXJ0eSJ9XX19LCJraW5kIjoiYXJyYXkifX1dfX0=")), "tagSpecifications") unless @tag_specifications.nil?
  @user_data = user_data
  Jsii::Type.check_type(@user_data, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "userData") unless @user_data.nil?
end

Instance Attribute Details

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

The block device mapping.



2237
2238
2239
# File 'ec2/cfn_launch_template.rb', line 2237

def block_device_mappings
  @block_device_mappings
end

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

The Capacity Reservation targeting option.

If you do not specify this parameter, the instance's Capacity Reservation preference defaults to open , which enables it to run in any open Capacity Reservation that has matching attributes (instance type, platform, Availability Zone).



2244
2245
2246
# File 'ec2/cfn_launch_template.rb', line 2244

def capacity_reservation_specification
  @capacity_reservation_specification
end

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

The CPU options for the instance.

For more information, see CPU options for Amazon EC2 instances in the Amazon EC2 User Guide .



2251
2252
2253
# File 'ec2/cfn_launch_template.rb', line 2251

def cpu_options
  @cpu_options
end

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

The credit option for CPU usage of the instance.

Valid only for T instances.



2258
2259
2260
# File 'ec2/cfn_launch_template.rb', line 2258

def credit_specification
  @credit_specification
end

#disable_api_stopBoolean, ... (readonly)

Indicates whether to enable the instance for stop protection.

For more information, see Enable stop protection for your EC2 instances in the Amazon EC2 User Guide .



2265
2266
2267
# File 'ec2/cfn_launch_template.rb', line 2265

def disable_api_stop
  @disable_api_stop
end

#disable_api_terminationBoolean, ... (readonly)

Indicates whether termination protection is enabled for the instance.

The default is false , which means that you can terminate the instance using the Amazon EC2 console, command line tools, or API. You can enable termination protection when you launch an instance, while the instance is running, or while the instance is stopped.



2272
2273
2274
# File 'ec2/cfn_launch_template.rb', line 2272

def disable_api_termination
  @disable_api_termination
end

#ebs_optimizedBoolean, ... (readonly)

Indicates whether the instance is optimized for Amazon EBS I/O.

This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal Amazon EBS I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS-optimized instance.



2279
2280
2281
# File 'ec2/cfn_launch_template.rb', line 2279

def ebs_optimized
  @ebs_optimized
end

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



2282
2283
2284
# File 'ec2/cfn_launch_template.rb', line 2282

def elastic_gpu_specifications
  @elastic_gpu_specifications
end

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



2285
2286
2287
# File 'ec2/cfn_launch_template.rb', line 2285

def elastic_inference_accelerators
  @elastic_inference_accelerators
end

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

Indicates whether the instance is enabled for AWS Nitro Enclaves.

For more information, see What is Nitro Enclaves? in the AWS Nitro Enclaves User Guide .

You can't enable AWS Nitro Enclaves and hibernation on the same instance.



2294
2295
2296
# File 'ec2/cfn_launch_template.rb', line 2294

def enclave_options
  @enclave_options
end

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

Indicates whether an instance is enabled for hibernation.

This parameter is valid only if the instance meets the hibernation prerequisites . For more information, see Hibernate your Amazon EC2 instance in the Amazon EC2 User Guide .



2301
2302
2303
# File 'ec2/cfn_launch_template.rb', line 2301

def hibernation_options
  @hibernation_options
end

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

The name or Amazon Resource Name (ARN) of an IAM instance profile.



2306
2307
2308
# File 'ec2/cfn_launch_template.rb', line 2306

def iam_instance_profile
  @iam_instance_profile
end

#image_idString? (readonly)

The ID of the AMI.

Alternatively, you can specify a Systems Manager parameter, which will resolve to an AMI ID on launch.

Valid formats:

  • ami-0ac394d6a3example
  • resolve:ssm:parameter-name
  • resolve:ssm:parameter-name:version-number
  • resolve:ssm:parameter-name:label

For more information, see Use a Systems Manager parameter to find an AMI in the Amazon Elastic Compute Cloud User Guide .



2322
2323
2324
# File 'ec2/cfn_launch_template.rb', line 2322

def image_id
  @image_id
end

#instance_initiated_shutdown_behaviorString? (readonly)

Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).

Default: stop



2329
2330
2331
# File 'ec2/cfn_launch_template.rb', line 2329

def instance_initiated_shutdown_behavior
  @instance_initiated_shutdown_behavior
end

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

The market (purchasing) option for the instances.



2334
2335
2336
# File 'ec2/cfn_launch_template.rb', line 2334

def instance_market_options
  @instance_market_options
end

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

The attributes for the instance types.

When you specify instance attributes, Amazon EC2 will identify instance types with these attributes.

You must specify VCpuCount and MemoryMiB . All other attributes are optional. Any unspecified optional attribute is set to its default.

When you specify multiple attributes, you get instance types that satisfy all of the specified attributes. If you specify multiple values for an attribute, you get instance types that satisfy any of the specified values.

To limit the list of instance types from which Amazon EC2 can identify matching instance types, you can use one of the following parameters, but not both in the same request:

  • AllowedInstanceTypes - The instance types to include in the list. All other instance types are ignored, even if they match your specified attributes.
  • ExcludedInstanceTypes - The instance types to exclude from the list, even if they match your specified attributes.

If you specify InstanceRequirements , you can't specify InstanceType .

Attribute-based instance type selection is only supported when using Auto Scaling groups, EC2 Fleet, and Spot Fleet to launch instances. If you plan to use the launch template in the launch instance wizard , or with the RunInstances API or AWS::EC2::Instance AWS CloudFormation resource, you can't specify InstanceRequirements .

For more information, see Specify attributes for instance type selection for EC2 Fleet or Spot Fleet and Spot placement score in the Amazon EC2 User Guide .



2356
2357
2358
# File 'ec2/cfn_launch_template.rb', line 2356

def instance_requirements
  @instance_requirements
end

#instance_typeString? (readonly)

The instance type. For more information, see Amazon EC2 instance types in the Amazon EC2 User Guide .

If you specify InstanceType , you can't specify InstanceRequirements .



2363
2364
2365
# File 'ec2/cfn_launch_template.rb', line 2363

def instance_type
  @instance_type
end

#kernel_idString? (readonly)

The ID of the kernel.

We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see User Provided Kernels in the Amazon EC2 User Guide .



2370
2371
2372
# File 'ec2/cfn_launch_template.rb', line 2370

def kernel_id
  @kernel_id
end

#key_nameString? (readonly)

The name of the key pair. You can create a key pair using CreateKeyPair or ImportKeyPair .

If you do not specify a key pair, you can't connect to the instance unless you choose an AMI that is configured to allow users another way to log in.



2377
2378
2379
# File 'ec2/cfn_launch_template.rb', line 2377

def key_name
  @key_name
end

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

The license configurations.



2382
2383
2384
# File 'ec2/cfn_launch_template.rb', line 2382

def license_specifications
  @license_specifications
end

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

The maintenance options of your instance.



2387
2388
2389
# File 'ec2/cfn_launch_template.rb', line 2387

def maintenance_options
  @maintenance_options
end

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

The metadata options for the instance.

For more information, see Configure the Instance Metadata Service options in the Amazon EC2 User Guide .



2394
2395
2396
# File 'ec2/cfn_launch_template.rb', line 2394

def 
  @metadata_options
end

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

The monitoring for the instance.



2399
2400
2401
# File 'ec2/cfn_launch_template.rb', line 2399

def monitoring
  @monitoring
end

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

The network interfaces for the instance.



2404
2405
2406
# File 'ec2/cfn_launch_template.rb', line 2404

def network_interfaces
  @network_interfaces
end

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

The settings for the network performance options for the instance.

For more information, see EC2 instance bandwidth weighting configuration .



2411
2412
2413
# File 'ec2/cfn_launch_template.rb', line 2411

def network_performance_options
  @network_performance_options
end

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

The placement for the instance.



2416
2417
2418
# File 'ec2/cfn_launch_template.rb', line 2416

def placement
  @placement
end

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

The hostname type for EC2 instances launched into this subnet and how DNS A and AAAA record queries should be handled.

For more information, see Amazon EC2 instance hostname types in the Amazon Elastic Compute Cloud User Guide .



2423
2424
2425
# File 'ec2/cfn_launch_template.rb', line 2423

def private_dns_name_options
  @private_dns_name_options
end

#ram_disk_idString? (readonly)

The ID of the RAM disk.

We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see User provided kernels in the Amazon EC2 User Guide .



2430
2431
2432
# File 'ec2/cfn_launch_template.rb', line 2430

def ram_disk_id
  @ram_disk_id
end

#security_group_idsArray<String>? (readonly)

The IDs of the security groups.

You can specify the IDs of existing security groups and references to resources created by the stack template.

If you specify a network interface, you must specify any security groups as part of the network interface instead.



2439
2440
2441
# File 'ec2/cfn_launch_template.rb', line 2439

def security_group_ids
  @security_group_ids
end

#security_groupsArray<String>? (readonly)

The names of the security groups. For a nondefault VPC, you must use security group IDs instead.

If you specify a network interface, you must specify any security groups as part of the network interface instead of using this parameter.



2446
2447
2448
# File 'ec2/cfn_launch_template.rb', line 2446

def security_groups
  @security_groups
end

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

The tags to apply to resources that are created during instance launch.

To tag the launch template itself, use TagSpecifications .



2453
2454
2455
# File 'ec2/cfn_launch_template.rb', line 2453

def tag_specifications
  @tag_specifications
end

#user_dataString? (readonly)

The user data to make available to the instance.

You must provide base64-encoded text. User data is limited to 16 KB. For more information, see Run commands when you launch an EC2 instance with user data input in the Amazon EC2 User Guide .

If you are creating the launch template for use with AWS Batch , the user data must be provided in the MIME multi-part archive format . For more information, see Amazon EC2 user data in launch templates in the AWS Batch User Guide .



2462
2463
2464
# File 'ec2/cfn_launch_template.rb', line 2462

def user_data
  @user_data
end

Class Method Details

.jsii_propertiesObject



2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
# File 'ec2/cfn_launch_template.rb', line 2464

def self.jsii_properties
  {
    :block_device_mappings => "blockDeviceMappings",
    :capacity_reservation_specification => "capacityReservationSpecification",
    :cpu_options => "cpuOptions",
    :credit_specification => "creditSpecification",
    :disable_api_stop => "disableApiStop",
    :disable_api_termination => "disableApiTermination",
    :ebs_optimized => "ebsOptimized",
    :elastic_gpu_specifications => "elasticGpuSpecifications",
    :elastic_inference_accelerators => "elasticInferenceAccelerators",
    :enclave_options => "enclaveOptions",
    :hibernation_options => "hibernationOptions",
    :iam_instance_profile => "iamInstanceProfile",
    :image_id => "imageId",
    :instance_initiated_shutdown_behavior => "instanceInitiatedShutdownBehavior",
    :instance_market_options => "instanceMarketOptions",
    :instance_requirements => "instanceRequirements",
    :instance_type => "instanceType",
    :kernel_id => "kernelId",
    :key_name => "keyName",
    :license_specifications => "licenseSpecifications",
    :maintenance_options => "maintenanceOptions",
    :metadata_options => "metadataOptions",
    :monitoring => "monitoring",
    :network_interfaces => "networkInterfaces",
    :network_performance_options => "networkPerformanceOptions",
    :placement => "placement",
    :private_dns_name_options => "privateDnsNameOptions",
    :ram_disk_id => "ramDiskId",
    :security_group_ids => "securityGroupIds",
    :security_groups => "securityGroups",
    :tag_specifications => "tagSpecifications",
    :user_data => "userData",
  }
end

Instance Method Details

#to_jsiiObject



2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
# File 'ec2/cfn_launch_template.rb', line 2501

def to_jsii
  result = {}
  result.merge!({
    "blockDeviceMappings" => @block_device_mappings,
    "capacityReservationSpecification" => @capacity_reservation_specification,
    "cpuOptions" => @cpu_options,
    "creditSpecification" => @credit_specification,
    "disableApiStop" => @disable_api_stop,
    "disableApiTermination" => @disable_api_termination,
    "ebsOptimized" => @ebs_optimized,
    "elasticGpuSpecifications" => @elastic_gpu_specifications,
    "elasticInferenceAccelerators" => @elastic_inference_accelerators,
    "enclaveOptions" => @enclave_options,
    "hibernationOptions" => @hibernation_options,
    "iamInstanceProfile" => @iam_instance_profile,
    "imageId" => @image_id,
    "instanceInitiatedShutdownBehavior" => @instance_initiated_shutdown_behavior,
    "instanceMarketOptions" => @instance_market_options,
    "instanceRequirements" => @instance_requirements,
    "instanceType" => @instance_type,
    "kernelId" => @kernel_id,
    "keyName" => @key_name,
    "licenseSpecifications" => @license_specifications,
    "maintenanceOptions" => @maintenance_options,
    "metadataOptions" => @metadata_options,
    "monitoring" => @monitoring,
    "networkInterfaces" => @network_interfaces,
    "networkPerformanceOptions" => @network_performance_options,
    "placement" => @placement,
    "privateDnsNameOptions" => @private_dns_name_options,
    "ramDiskId" => @ram_disk_id,
    "securityGroupIds" => @security_group_ids,
    "securityGroups" => @security_groups,
    "tagSpecifications" => @tag_specifications,
    "userData" => @user_data,
  })
  result.compact
end