Class: AWSCDK::EC2::CfnEC2Fleet::TargetCapacitySpecificationRequestProperty

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

Overview

Specifies the number of units to request for an EC2 Fleet.

You can choose to set the target capacity in terms of instances or a performance characteristic that is important to your application workload, such as vCPUs, memory, or I/O. If the request type is maintain , you can specify a target capacity of 0 and add capacity later.

TargetCapacitySpecificationRequest is a property of the AWS::EC2::EC2Fleet resource.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(total_target_capacity:, default_target_capacity_type: nil, on_demand_target_capacity: nil, spot_target_capacity: nil, target_capacity_unit_type: nil) ⇒ TargetCapacitySpecificationRequestProperty

Returns a new instance of TargetCapacitySpecificationRequestProperty.

Parameters:

  • total_target_capacity (Numeric)

    The number of units to request, filled using the default target capacity type.

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

    The default target capacity type.

  • on_demand_target_capacity (Numeric, nil) (defaults to: nil)

    The number of On-Demand units to request.

  • spot_target_capacity (Numeric, nil) (defaults to: nil)

    The number of Spot units to request.

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

    The unit for the target capacity. You can specify this parameter only when using attributed-based instance type selection.



2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
# File 'ec2/cfn_ec2_fleet.rb', line 2989

def initialize(total_target_capacity:, default_target_capacity_type: nil, on_demand_target_capacity: nil, spot_target_capacity: nil, target_capacity_unit_type: nil)
  @total_target_capacity = total_target_capacity
  Jsii::Type.check_type(@total_target_capacity, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "totalTargetCapacity")
  @default_target_capacity_type = default_target_capacity_type
  Jsii::Type.check_type(@default_target_capacity_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "defaultTargetCapacityType") unless @default_target_capacity_type.nil?
  @on_demand_target_capacity = on_demand_target_capacity
  Jsii::Type.check_type(@on_demand_target_capacity, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "onDemandTargetCapacity") unless @on_demand_target_capacity.nil?
  @spot_target_capacity = spot_target_capacity
  Jsii::Type.check_type(@spot_target_capacity, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "spotTargetCapacity") unless @spot_target_capacity.nil?
  @target_capacity_unit_type = target_capacity_unit_type
  Jsii::Type.check_type(@target_capacity_unit_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "targetCapacityUnitType") unless @target_capacity_unit_type.nil?
end

Instance Attribute Details

#default_target_capacity_typeString? (readonly)

The default target capacity type.



3011
3012
3013
# File 'ec2/cfn_ec2_fleet.rb', line 3011

def default_target_capacity_type
  @default_target_capacity_type
end

#on_demand_target_capacityNumeric? (readonly)

The number of On-Demand units to request.



3016
3017
3018
# File 'ec2/cfn_ec2_fleet.rb', line 3016

def on_demand_target_capacity
  @on_demand_target_capacity
end

#spot_target_capacityNumeric? (readonly)

The number of Spot units to request.



3021
3022
3023
# File 'ec2/cfn_ec2_fleet.rb', line 3021

def spot_target_capacity
  @spot_target_capacity
end

#target_capacity_unit_typeString? (readonly)

The unit for the target capacity. You can specify this parameter only when using attributed-based instance type selection.

Default: units (the number of instances)



3028
3029
3030
# File 'ec2/cfn_ec2_fleet.rb', line 3028

def target_capacity_unit_type
  @target_capacity_unit_type
end

#total_target_capacityNumeric (readonly)

The number of units to request, filled using the default target capacity type.



3006
3007
3008
# File 'ec2/cfn_ec2_fleet.rb', line 3006

def total_target_capacity
  @total_target_capacity
end

Class Method Details

.jsii_propertiesObject



3030
3031
3032
3033
3034
3035
3036
3037
3038
# File 'ec2/cfn_ec2_fleet.rb', line 3030

def self.jsii_properties
  {
    :total_target_capacity => "totalTargetCapacity",
    :default_target_capacity_type => "defaultTargetCapacityType",
    :on_demand_target_capacity => "onDemandTargetCapacity",
    :spot_target_capacity => "spotTargetCapacity",
    :target_capacity_unit_type => "targetCapacityUnitType",
  }
end

Instance Method Details

#to_jsiiObject



3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
# File 'ec2/cfn_ec2_fleet.rb', line 3040

def to_jsii
  result = {}
  result.merge!({
    "totalTargetCapacity" => @total_target_capacity,
    "defaultTargetCapacityType" => @default_target_capacity_type,
    "onDemandTargetCapacity" => @on_demand_target_capacity,
    "spotTargetCapacity" => @spot_target_capacity,
    "targetCapacityUnitType" => @target_capacity_unit_type,
  })
  result.compact
end