Documentation ¶
Index ¶
- Variables
- func CreateTag(instanceId, tagKey, tagValue string) error
- func DetachInstance(asName, instanceId string) error
- func FilterInstancesByTag(asInstances []*autoscaling.Instance, tag string) ([]*ec2.Instance, error)
- func GetTags(instanceId string) ([]*ec2.TagDescription, error)
- func PutMetricData(metricName string, value float64) error
- func RemoveTag(instanceId, tagKey string) error
- func ScaleAS(name string, desired int) error
- func TerminateInstance(instanceId string) error
- type ASMeta
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNoInstancesGive = errors.New("no instances given")
)
Functions ¶
func DetachInstance ¶
func FilterInstancesByTag ¶
given a []autoscaling.Instance and a tag-key, filter instances that have the given tag-key and return a []ec2.Instance or an error
func PutMetricData ¶
func TerminateInstance ¶
Terminate the given instance
Types ¶
type ASMeta ¶
type ASMeta struct {
MinSize, MaxSize int // stored as "MinSize" and "MaxSize" of the AS
MinFree, MaxFree int // stored as tags "min-free" and "max-free"
Instances []*autoscaling.Instance // list of *all* instances
Healthy []*autoscaling.Instance // list of instances that are InService and Healthy
}
Instead of maintaing these values as constants, we use the AS itself to store them.
This prevents a situation in where the environments (i.e. dev and alpha) don't agree on the constant values and their watchdogs induce flapping on the shared AS.
Click to show internal directories.
Click to hide internal directories.