Documentation ¶
Index ¶
- func Configure(c *Config) (*awssession.Session, error)
- type Config
- type LifeCycle
- func (l *LifeCycle) AttachNotificationToAutoScaling() error
- func (l *LifeCycle) Close() error
- func (l *LifeCycle) Configure(name string) error
- func (l *LifeCycle) EnureSNS(name string) error
- func (l *LifeCycle) GetAutoScalingOperatingMachines() ([]*ec2.Instance, error)
- func (l *LifeCycle) Listen(callback func([]*ec2.Instance) error) error
- func (l *LifeCycle) MakeSureSQS(name string) error
- func (l *LifeCycle) MakeSureSubscriptions() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 ¶
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 ¶
AttachNotificationToAutoScaling attaches topic to autoscaling group, multiple calls to this function will result in same
func (*LifeCycle) Close ¶
Close closes lifecycle management system for proxy machines, it doesn't cleanup anything
func (*LifeCycle) Configure ¶
Configure configures lifecycle, upserts SNS, SQS, Subscriptions, Notification
func (*LifeCycle) EnureSNS ¶
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 ¶
GetAutoScalingOperatingIPs gets the Healthy and InService servers' IP addresses of an autscaling group
func (*LifeCycle) MakeSureSQS ¶
MakeSureSQS configures a queue for listening to a predefined system
func (*LifeCycle) MakeSureSubscriptions ¶
MakeSureSubscriptions upserts subscription between sns and sqs