core

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 17, 2017 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetNotificationChannel

func GetNotificationChannel(currentSession *session.Session) *chan string

GetNotificationChannel - returns notification channel to publish messages to Cloudwatch

func PickAutoscalingGroup

func PickAutoscalingGroup(currentSession *session.Session, requiredTags *map[string]string) (*autoscaling.Group, error)

PickAutoscalingGroup - picks eligible autoscaling group

func PickInstance

func PickInstance(currentSession *session.Session, autoscalingGroup *autoscaling.Group, requiredTags *map[string]string) (*ec2.Instance, error)

PickInstance - picks eligible instance

func PickStoppedInstances

func PickStoppedInstances(currentSession *session.Session, requiredTags *map[string]string) ([]*ec2.Instance, error)

func PokeWithAStick

func PokeWithAStick(currentSession *session.Session, config *StateControlConfiguration) error

PokeWithAStick - stops an eligible instance

func RestoreInstances

func RestoreInstances(currentSession *session.Session, config *StateControlConfiguration) error

RestoreInstances - starts previously stopped instances

func StartInstances

func StartInstances(currentSession *session.Session, instances []*ec2.Instance, tagKey *string) error

func StopInstance

func StopInstance(currentSession *session.Session, instance *ec2.Instance, tagKey *string) error

StopInstance - tags instance and stops it

func TerminateInstance

func TerminateInstance(currentSession *session.Session, instance *ec2.Instance, tagKey *string) error

TerminateInstance - tags instance and terminates it

func ThrowBanana

func ThrowBanana(currentSession *session.Session, config *StateControlConfiguration) error

ThrowBanana - throws a banana to terminate eligible instance in Autoscaling group

Types

type Configuration

type Configuration struct {
	Terminate *StateControlConfiguration
	Stop      *StateControlConfiguration
	Restore   *StateControlConfiguration
}

Configuration - describes configuration file

func ReadConfigiguration

func ReadConfigiguration(filename string) Configuration

ReadConfigiguration - gets configuration file from the specified location and applies the default values if needed

type StateControlConfiguration

type StateControlConfiguration struct {
	Instances   *map[string]string
	Autoscaling *map[string]string
	Tag         *string
}

StateControlConfiguration - describes part of the configuration responsible for state control

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL