awsEc2

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2019 License: LGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connector

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

Connector is a object that allows to interact with nomad worker

func New added in v0.0.10

func New(asgTagKey, awsProfile string, options ...Option) (*Connector, error)

New creates a new nomad connector The profile represents the name of the aws profile that shall be used to access the resources to scale the aws AutoScalingGroup. This parameter is optional. If the profile is NOT set the instance where sokar runs on has to have enough permissions to access the resources (ASG) for scaling (e.g. granted by a AWS Instance Profile). In this case the region parameter has to be specified instead (via WithAwsRegion()).

func (*Connector) AdjustScalingObjectCount

func (c *Connector) AdjustScalingObjectCount(autoScalingGroup string, min uint, max uint, from uint, to uint) error

AdjustScalingObjectCount will scale the AutoScalingGroup to the desired count (amount of instances)

func (*Connector) GetScalingObjectCount

func (c *Connector) GetScalingObjectCount(datacenter string) (uint, error)

GetScalingObjectCount will return the count of the nomad workers

func (*Connector) IsScalingObjectDead

func (c *Connector) IsScalingObjectDead(datacenter string) (bool, error)

IsScalingObjectDead will return if the nomad workers of the actual data-center are still available.

func (*Connector) String

func (c *Connector) String() string

type Option added in v0.0.10

type Option func(c *Connector)

Option represents an option for the awsEc2 Connector

func WithAwsRegion added in v0.0.10

func WithAwsRegion(region string) Option

WithAwsRegion sets the aws region in which the resource to be scaled can be found

func WithLogger added in v0.0.10

func WithLogger(logger zerolog.Logger) Option

WithLogger adds a configured Logger to the awsEc2 Connector

Jump to

Keyboard shortcuts

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