Class: AWSCDK::EC2::CfnEC2Fleet::FleetLaunchTemplateOverridesRequestProperty
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::EC2::CfnEC2Fleet::FleetLaunchTemplateOverridesRequestProperty
- Defined in:
- ec2/cfn_ec2_fleet.rb
Overview
Specifies overrides for a launch template for an EC2 Fleet.
FleetLaunchTemplateOverridesRequest is a property of the FleetLaunchTemplateConfigRequest property type.
Instance Attribute Summary collapse
-
#availability_zone ⇒ String?
readonly
The Availability Zone in which to launch the instances.
-
#availability_zone_id ⇒ String?
readonly
The ID of the Availability Zone in which to launch the instances.
-
#block_device_mappings ⇒ AWSCDK::IResolvable, ...
readonly
The block device mappings, which define the EBS volumes and instance store volumes to attach to the instance at launch.
- #iam_instance_profile ⇒ AWSCDK::IResolvable, ... readonly
-
#instance_requirements ⇒ AWSCDK::IResolvable, ...
readonly
The attributes for the instance types.
-
#instance_type ⇒ String?
readonly
The instance type.
- #key_name ⇒ String? readonly
-
#max_price ⇒ String?
readonly
The maximum price per unit hour that you are willing to pay for a Spot Instance.
- #metadata_options ⇒ AWSCDK::IResolvable, ... readonly
- #network_interfaces ⇒ AWSCDK::IResolvable, ... readonly
-
#placement ⇒ AWSCDK::IResolvable, ...
readonly
The location where the instance launched, if applicable.
-
#priority ⇒ Numeric?
readonly
The priority for the launch template override.
-
#subnet_id ⇒ String?
readonly
The IDs of the subnets in which to launch the instances.
-
#weighted_capacity ⇒ Numeric?
readonly
The number of units provided by the specified instance type.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(availability_zone: nil, availability_zone_id: nil, block_device_mappings: nil, iam_instance_profile: nil, instance_requirements: nil, instance_type: nil, key_name: nil, max_price: nil, metadata_options: nil, network_interfaces: nil, placement: nil, priority: nil, subnet_id: nil, weighted_capacity: nil) ⇒ FleetLaunchTemplateOverridesRequestProperty
constructor
A new instance of FleetLaunchTemplateOverridesRequestProperty.
- #to_jsii ⇒ Object
Constructor Details
#initialize(availability_zone: nil, availability_zone_id: nil, block_device_mappings: nil, iam_instance_profile: nil, instance_requirements: nil, instance_type: nil, key_name: nil, max_price: nil, metadata_options: nil, network_interfaces: nil, placement: nil, priority: nil, subnet_id: nil, weighted_capacity: nil) ⇒ FleetLaunchTemplateOverridesRequestProperty
Returns a new instance of FleetLaunchTemplateOverridesRequestProperty.
1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 |
# File 'ec2/cfn_ec2_fleet.rb', line 1269 def initialize(availability_zone: nil, availability_zone_id: nil, block_device_mappings: nil, iam_instance_profile: nil, instance_requirements: nil, instance_type: nil, key_name: nil, max_price: nil, metadata_options: nil, network_interfaces: nil, placement: nil, priority: nil, subnet_id: nil, weighted_capacity: nil) @availability_zone = availability_zone Jsii::Type.check_type(@availability_zone, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "availabilityZone") unless @availability_zone.nil? @availability_zone_id = availability_zone_id Jsii::Type.check_type(@availability_zone_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "availabilityZoneId") unless @availability_zone_id.nil? @block_device_mappings = block_device_mappings Jsii::Type.check_type(@block_device_mappings, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLkNmbkVDMkZsZWV0LkJsb2NrRGV2aWNlTWFwcGluZ1Byb3BlcnR5In1dfX0sImtpbmQiOiJhcnJheSJ9fV19fQ==")), "blockDeviceMappings") unless @block_device_mappings.nil? @iam_instance_profile = iam_instance_profile.is_a?(Hash) ? ::AWSCDK::EC2::CfnEC2Fleet::IAMInstanceProfileSpecificationProperty.new(**iam_instance_profile.transform_keys(&:to_sym)) : iam_instance_profile Jsii::Type.check_type(@iam_instance_profile, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuQ2ZuRUMyRmxlZXQuSWFtSW5zdGFuY2VQcm9maWxlU3BlY2lmaWNhdGlvblByb3BlcnR5In1dfX0=")), "iamInstanceProfile") unless @iam_instance_profile.nil? @instance_requirements = instance_requirements.is_a?(Hash) ? ::AWSCDK::EC2::CfnEC2Fleet::InstanceRequirementsRequestProperty.new(**instance_requirements.transform_keys(&:to_sym)) : instance_requirements Jsii::Type.check_type(@instance_requirements, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuQ2ZuRUMyRmxlZXQuSW5zdGFuY2VSZXF1aXJlbWVudHNSZXF1ZXN0UHJvcGVydHkifV19fQ==")), "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? @key_name = key_name Jsii::Type.check_type(@key_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "keyName") unless @key_name.nil? @max_price = max_price Jsii::Type.check_type(@max_price, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "maxPrice") unless @max_price.nil? @metadata_options = .is_a?(Hash) ? ::AWSCDK::EC2::CfnEC2Fleet::InstanceMetadataOptionsRequestProperty.new(**.transform_keys(&:to_sym)) : Jsii::Type.check_type(@metadata_options, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuQ2ZuRUMyRmxlZXQuSW5zdGFuY2VNZXRhZGF0YU9wdGlvbnNSZXF1ZXN0UHJvcGVydHkifV19fQ==")), "metadataOptions") unless @metadata_options.nil? @network_interfaces = network_interfaces Jsii::Type.check_type(@network_interfaces, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLkNmbkVDMkZsZWV0Lk5ldHdvcmtJbnRlcmZhY2VTcGVjaWZpY2F0aW9uUmVxdWVzdFByb3BlcnR5In1dfX0sImtpbmQiOiJhcnJheSJ9fV19fQ==")), "networkInterfaces") unless @network_interfaces.nil? @placement = placement.is_a?(Hash) ? ::AWSCDK::EC2::CfnEC2Fleet::PlacementProperty.new(**placement.transform_keys(&:to_sym)) : placement Jsii::Type.check_type(@placement, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuQ2ZuRUMyRmxlZXQuUGxhY2VtZW50UHJvcGVydHkifV19fQ==")), "placement") unless @placement.nil? @priority = priority Jsii::Type.check_type(@priority, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "priority") unless @priority.nil? @subnet_id = subnet_id Jsii::Type.check_type(@subnet_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "subnetId") unless @subnet_id.nil? @weighted_capacity = weighted_capacity Jsii::Type.check_type(@weighted_capacity, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "weightedCapacity") unless @weighted_capacity.nil? end |
Instance Attribute Details
#availability_zone ⇒ String? (readonly)
The Availability Zone in which to launch the instances. For example, us-east-2a .
Either AvailabilityZone or AvailabilityZoneId must be specified in the request, but not both.
1306 1307 1308 |
# File 'ec2/cfn_ec2_fleet.rb', line 1306 def availability_zone @availability_zone end |
#availability_zone_id ⇒ String? (readonly)
The ID of the Availability Zone in which to launch the instances. For example, use2-az1 .
Either AvailabilityZone or AvailabilityZoneId must be specified in the request, but not both.
1313 1314 1315 |
# File 'ec2/cfn_ec2_fleet.rb', line 1313 def availability_zone_id @availability_zone_id end |
#block_device_mappings ⇒ AWSCDK::IResolvable, ... (readonly)
The block device mappings, which define the EBS volumes and instance store volumes to attach to the instance at launch.
Supported only for fleets of type instant .
For more information, see Block device mappings for volumes on Amazon EC2 instances in the Amazon EC2 User Guide .
1322 1323 1324 |
# File 'ec2/cfn_ec2_fleet.rb', line 1322 def block_device_mappings @block_device_mappings end |
#iam_instance_profile ⇒ AWSCDK::IResolvable, ... (readonly)
1325 1326 1327 |
# File 'ec2/cfn_ec2_fleet.rb', line 1325 def iam_instance_profile @iam_instance_profile end |
#instance_requirements ⇒ AWSCDK::IResolvable, ... (readonly)
The attributes for the instance types.
When you specify instance attributes, Amazon EC2 will identify instance types with those attributes.
If you specify
InstanceRequirements, you can't specifyInstanceType.
1334 1335 1336 |
# File 'ec2/cfn_ec2_fleet.rb', line 1334 def instance_requirements @instance_requirements end |
#instance_type ⇒ String? (readonly)
The instance type.
mac1.metal is not supported as a launch template override.
If you specify
InstanceType, you can't specifyInstanceRequirements.
1343 1344 1345 |
# File 'ec2/cfn_ec2_fleet.rb', line 1343 def instance_type @instance_type end |
#key_name ⇒ String? (readonly)
1346 1347 1348 |
# File 'ec2/cfn_ec2_fleet.rb', line 1346 def key_name @key_name end |
#max_price ⇒ String? (readonly)
The maximum price per unit hour that you are willing to pay for a Spot Instance.
We do not recommend using this parameter because it can lead to increased interruptions. If you do not specify this parameter, you will pay the current Spot price.
If you specify a maximum price, your instances will be interrupted more frequently than if you do not specify this parameter.
If you specify a maximum price, it must be more than USD $0.001. Specifying a value below USD $0.001 will result in an
InvalidParameterValueerror message.
1357 1358 1359 |
# File 'ec2/cfn_ec2_fleet.rb', line 1357 def max_price @max_price end |
#metadata_options ⇒ AWSCDK::IResolvable, ... (readonly)
1360 1361 1362 |
# File 'ec2/cfn_ec2_fleet.rb', line 1360 def @metadata_options end |
#network_interfaces ⇒ AWSCDK::IResolvable, ... (readonly)
1363 1364 1365 |
# File 'ec2/cfn_ec2_fleet.rb', line 1363 def network_interfaces @network_interfaces end |
#placement ⇒ AWSCDK::IResolvable, ... (readonly)
The location where the instance launched, if applicable.
1368 1369 1370 |
# File 'ec2/cfn_ec2_fleet.rb', line 1368 def placement @placement end |
#priority ⇒ Numeric? (readonly)
The priority for the launch template override. The highest priority is launched first.
If the On-Demand AllocationStrategy is set to prioritized , EC2 Fleet uses priority to determine which launch template override to use first in fulfilling On-Demand capacity.
If the Spot AllocationStrategy is set to capacity-optimized-prioritized , EC2 Fleet uses priority on a best-effort basis to determine which launch template override to use in fulfilling Spot capacity, but optimizes for capacity first.
Valid values are whole numbers starting at 0 . The lower the number, the higher the priority. If no number is set, the launch template override has the lowest priority. You can set the same priority for different launch template overrides.
1379 1380 1381 |
# File 'ec2/cfn_ec2_fleet.rb', line 1379 def priority @priority end |
#subnet_id ⇒ String? (readonly)
The IDs of the subnets in which to launch the instances.
Separate multiple subnet IDs using commas (for example, subnet-1234abcdeexample1, subnet-0987cdef6example2 ). A request of type instant can have only one subnet ID.
1386 1387 1388 |
# File 'ec2/cfn_ec2_fleet.rb', line 1386 def subnet_id @subnet_id end |
#weighted_capacity ⇒ Numeric? (readonly)
The number of units provided by the specified instance type.
These are the same units that you chose to set the target capacity in terms of instances, or a performance characteristic such as vCPUs, memory, or I/O.
If the target capacity divided by this value is not a whole number, Amazon EC2 rounds the number of instances to the next whole number. If this value is not specified, the default is 1.
When specifying weights, the price used in the
lowest-priceandprice-capacity-optimizedallocation strategies is per unit hour (where the instance price is divided by the specified weight). However, if all the specified weights are above the requestedTargetCapacity, resulting in only 1 instance being launched, the price used is per instance hour.
1397 1398 1399 |
# File 'ec2/cfn_ec2_fleet.rb', line 1397 def weighted_capacity @weighted_capacity end |
Class Method Details
.jsii_properties ⇒ Object
1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 |
# File 'ec2/cfn_ec2_fleet.rb', line 1399 def self.jsii_properties { :availability_zone => "availabilityZone", :availability_zone_id => "availabilityZoneId", :block_device_mappings => "blockDeviceMappings", :iam_instance_profile => "iamInstanceProfile", :instance_requirements => "instanceRequirements", :instance_type => "instanceType", :key_name => "keyName", :max_price => "maxPrice", :metadata_options => "metadataOptions", :network_interfaces => "networkInterfaces", :placement => "placement", :priority => "priority", :subnet_id => "subnetId", :weighted_capacity => "weightedCapacity", } end |
Instance Method Details
#to_jsii ⇒ Object
1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 |
# File 'ec2/cfn_ec2_fleet.rb', line 1418 def to_jsii result = {} result.merge!({ "availabilityZone" => @availability_zone, "availabilityZoneId" => @availability_zone_id, "blockDeviceMappings" => @block_device_mappings, "iamInstanceProfile" => @iam_instance_profile, "instanceRequirements" => @instance_requirements, "instanceType" => @instance_type, "keyName" => @key_name, "maxPrice" => @max_price, "metadataOptions" => @metadata_options, "networkInterfaces" => @network_interfaces, "placement" => @placement, "priority" => @priority, "subnetId" => @subnet_id, "weightedCapacity" => @weighted_capacity, }) result.compact end |