Documentation ¶
Overview ¶
Package ec2 contains functions for inspecting EC2 instance types and searching for a similar instance types.
Index ¶
Constants ¶
View Source
const ( OnDemandMarketType = "on-demand" SpotMarketType = "spot" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // IgnoreFamily ignore instance family IgnoreFamily bool // IgnoreGeneration ignore instance generation IgnoreGeneration bool // MultiplyFactorUpper a multiplier for the upper limit of the VCPU size MultiplyFactorUpper int // MultiplyFactorUpper a multiplier for the lower limit of the VCPU size MultiplyFactorLower int }
A Config is used for tuning the EC2 similarity algorithm
type InstanceDescriber ¶
type InstanceDescriber interface {
GetInstanceDetails(ctx context.Context, ltSpec *autoscaling.LaunchTemplateSpecification) (*InstanceDetails, error)
}
InstanceDescriber contains methods for extracting and inspecting instance types
func NewInstanceDescriber ¶
func NewInstanceDescriber(role sts.AssumeRoleInRegion) InstanceDescriber
NewInstanceDescriber create new InstanceDescriber
type InstanceDetails ¶
type InstanceTypeWeight ¶
type InstanceTypeWeight struct { // InstanceType instance type name, like `m5.4xlarge` InstanceType string // Weight instance weight for MixedInstancePolicy; equal to the VCPU number Weight int }
InstanceTypeWeight EC2 instance type record that contains type name and weight (equal to the VCPU number)
func GetSimilarTypes ¶
func GetSimilarTypes(instanceType string, config Config) []InstanceTypeWeight
GetSimilarTypes find EC2 instances, that are similar to the specified EC2 instance type. The algorithm compares between instance types over multiple dimensions. It returns a list of "similar" EC2 instance types (with weights)
Click to show internal directories.
Click to hide internal directories.