package
0.0.0-20200701220749-19dab7b74acb
Repository: https://github.com/jjones-smug/autospotting.git
Documentation: pkg.go.dev

# Functions

GetInstanceIDDueForTermination checks if the given CloudWatch event data is triggered from a spot terminationIf it is a termination event for a spot instance, it returns the instance id present in the event data.
NewSpotTermination is a constructor for creating an instance of spotTermination to call DetachInstance.
ParseConfig loads configuration from command line flags, environments variables, and config files.
Run starts processing all AWS regions looking for AutoScaling groups enabled and taking action by replacing more pricy on-demand instances with compatible and cheaper spot instances.

# Constants

AllowedInstanceTypesTag is the name of a tag that can indicate which instance types are allowed in the current group.
AutoScalingTerminationMethod uses the TerminateInstanceInAutoScalingGroup API method to terminate instances.
AutoTerminationNotificationAction if ASG has a LifeCycleHook with LifecycleTransition = EC2_INSTANCE_TERMINATING terminate the spot instance (as TerminateTerminationNotificationAction), if not detach it.
BiddingPolicyTag stores the bidding policy for the spot instance.
CronScheduleState controls whether to run or not to run during the time interval specified in the Schedule variable or its per-group tag overrides.
CronScheduleStateTag is the name of the tag set on the AutoScaling Group that can override the global value of the CronScheduleState parameter.
DefaultBiddingPolicy stores the default bidding policy for the spot bid on a per-group level.
DefaultInstanceTerminationMethod is the default value for the instance termination method configuration option.
Workaround: Maximum value for initial grace period, which can override the setting pulled from the ASG configs for the group.
DefaultMinOnDemandValue stores the default on-demand capacity to be kept running in a group managed by autospotting.
DefaultSchedule is the default value for the execution schedule in simplified Cron-style definition the cron format only accepts the hour and day of week fields, for example "9-18 1-5" would define the working week hours.
DefaultSpotPriceBufferPercentage stores the default percentage value above the current spot price to place a bid.
DefaultSpotProductDescription stores the default operating system to use when looking up spot price history in the market.
DefaultSpotProductPremium stores the default value to add to the on demand price for premium instance types.
Maximum amount of time a spot request can be "open" before it's cancelled.
DefaultTerminationNotificationAction is the default value for the termination notification action configuration option.
DetachTerminationMethod detaches the instance from the Auto Scaling Group and then terminates it.
DetachTerminationNotificationAction detach the spot instance, which will be terminated by AWS in 2 minutes, without reducing the ASG capacity, so that a new instance will be launched.
DisallowedInstanceTypesTag is the name of a tag that can indicate which instance types are not allowed in the current group.
OnDemandNumberLong is the name of a tag that can be defined on a per-group level for overriding maintained on-demand capacity given as an absolute number.
OnDemandPercentageTag is the name of a tag that can be defined on a per-group level for overriding maintained on-demand capacity given as a percentage of the group's running instances.
PatchBeanstalkUserdataTag is the name of the tag set on the AutoScaling Group that can override the global value of the PatchBeanstalkUserdata parameter.
ScheduleTag is the name of the tag set on the AutoScaling Group that can override the global value of the Schedule parameter.
SpotPriceBufferPercentageTag stores percentage value above the current spot price to place the bid.
TerminateTerminationNotificationAction terminate the spot instance, which will be terminated by AWS in 2 minutes, without reducing the ASG capacity, so that a new instance will be launched.
TimezoneTag is the name of the tag set on the AutoScaling Group that can override the global value of the Timezone parameter.

# Structs

AutoScalingConfig stores some group-specific configurations that can override their corresponding global values.
Config extends the AutoScalingConfig struct and in addition contains a number of global flags.
SpotTermination is used to detach an instance, used when a spot instance is due for termination.
Tag represents an Asg Tag: Key, Value.