asgd

package module
v0.0.0-...-a7daa13 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2016 License: MIT Imports: 14 Imported by: 1

README

asgd

asgd is a lightweight configuration management tool focused on keeping local configuration files up-to-date using ASG events

Building

$ git clone https://github.com/koding/asgd.git
$ cd ./asgd
$ go get ./...
$ go build -o asgd ./cmd/asgd

You should now have asgd

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Configure

func Configure(c *Config) (*awssession.Session, error)

Configure prepares configuration data for tunnelproxy manager

Types

type Config

type Config struct {
	Name string

	// required
	AccessKeyID     string
	SecretAccessKey string

	// can be overriden
	Region          string
	AutoScalingName string

	// optional
	Debug bool
}

Config holds configuration parameters for asgd

type LifeCycle

type LifeCycle struct {
	// contains filtered or unexported fields
}

LifeCycle handles AWS resource managements

func NewLifeCycle

func NewLifeCycle(session *session.Session, log logging.Logger, asgName string) *LifeCycle

NewLifeCycle creates a new lifecycle management system, everything begins with an autoscaling resource, we are listening to any change on that resource, to be able to listen them we are attaching a notification configuration to given autoscaling resource, notification configuration works with a TopicARN, which is basically a SNS Topic, to be able to listen from a Topic ARN we need a SQS, SQS is attached to Notification Topic and configured to pass events as soon as they occur, it also has re- try mechanism. One event only be handled by one manager, there wont be any race condition on processing that particular message. Manager is idempotent, if any given resource doesnt exist in the given AWS system, it will create or re-use the previous ones

func (*LifeCycle) AttachNotificationToAutoScaling

func (l *LifeCycle) AttachNotificationToAutoScaling() error

AttachNotificationToAutoScaling attaches topic to autoscaling group, multiple calls to this function will result in same

func (*LifeCycle) Close

func (l *LifeCycle) Close() error

Close closes lifecycle management system for proxy machines, it doesn't cleanup anything

func (*LifeCycle) Configure

func (l *LifeCycle) Configure(name string) error

Configure configures lifecycle, upserts SNS, SQS, Subscriptions, Notification

func (*LifeCycle) EnureSNS

func (l *LifeCycle) EnureSNS(name string) error

EnureSNS creates or gets required Topic ARN for lifecycle management, that will be attached to autoscaling group. This function is idempotent, multiple calls will result with same response

func (*LifeCycle) GetAutoScalingOperatingMachines

func (l *LifeCycle) GetAutoScalingOperatingMachines() ([]*ec2.Instance, error)

GetAutoScalingOperatingIPs gets the Healthy and InService servers' IP addresses of an autscaling group

func (*LifeCycle) Listen

func (l *LifeCycle) Listen(callback func([]*ec2.Instance) error) error

Listen listens for messages that are put into lifecycle queues

func (*LifeCycle) MakeSureSQS

func (l *LifeCycle) MakeSureSQS(name string) error

MakeSureSQS configures a queue for listening to a predefined system

func (*LifeCycle) MakeSureSubscriptions

func (l *LifeCycle) MakeSureSubscriptions() error

MakeSureSubscriptions upserts subscription between sns and sqs

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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