lib

package
v0.0.0-...-bdb8132 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var InstanceTypes = map[string]InstanceType{
	"t2.nano": {
		CPUUnits: 1 * SingleCPUUnits,
		MemoryMb: 512,
	},
	"t2.micro": {
		CPUUnits: 1 * SingleCPUUnits,
		MemoryMb: 1 * MbInGb,
	},
	"t2.small": {
		CPUUnits: 1 * SingleCPUUnits,
		MemoryMb: 2 * MbInGb,
	},
	"t2.medium": {
		CPUUnits: 2 * SingleCPUUnits,
		MemoryMb: 4 * MbInGb,
	},
	"t2.large": {
		CPUUnits: 2 * SingleCPUUnits,
		MemoryMb: 8 * MbInGb,
	},
	"t2.xlarge": {
		CPUUnits: 4 * SingleCPUUnits,
		MemoryMb: 16 * MbInGb,
	},
	"t2.2xlarge": {
		CPUUnits: 8 * SingleCPUUnits,
		MemoryMb: 32 * MbInGb,
	},
}
View Source
var MbInGb int64 = 985 // only 985 out of 1024 is available for use due to ECS agent
View Source
var SingleCPUUnits int64 = 1024

Functions

func DescribeEcsServicesForArns

func DescribeEcsServicesForArns(awsSess *session.Session, serviceArns []*string, cluster string) ([]*ecs.Service, error)

func DetachAndReplaceAsgInstances

func DetachAndReplaceAsgInstances(awsSess *session.Session, asgName string, instancesToTerminate []*string)

func GetAsg

func GetAsg(awsSess *session.Session, asgName string) *autoscaling.Group

func GetAsgNameForEcsCluster

func GetAsgNameForEcsCluster(awsSess *session.Session, cluster string) string

func GetAsgServerCount

func GetAsgServerCount(awsSess *session.Session, asgName string) (desired int64, min int64, max int64)

func GetInstanceIDsForEcsCluster

func GetInstanceIDsForEcsCluster(awsSess *session.Session, clusterName string) []*string

func GetInstanceIPsForEcsCluster

func GetInstanceIPsForEcsCluster(awsSess *session.Session, clusterName string) []string

func GetInstanceListForAsg

func GetInstanceListForAsg(awsSess *session.Session, asgName string) []*string

func GetInstanceListForEcsCluster

func GetInstanceListForEcsCluster(awsSess *session.Session, clusterName string) []*ecs.ContainerInstance

func GetInstanceTypeForAsg

func GetInstanceTypeForAsg(awsSess *session.Session, asgName string) string

func GetLargestDesiredCountFromEcsServices

func GetLargestDesiredCountFromEcsServices(ecsServices []*ecs.Service) int64

func GetMemoryCpuNeededForEcsServices

func GetMemoryCpuNeededForEcsServices(awsSess *session.Session, ecsServices []*ecs.Service) (int64, int64)

func GetPendingEcsTasksCount

func GetPendingEcsTasksCount(awsSess *session.Session, cluster string) int64

func HowManyServersNeededForAsg

func HowManyServersNeededForAsg(serverType string, memory, cpu int64) int64

func LambdaInvoke

func LambdaInvoke(awsSess *session.Session, functionName, payload string) (*lambda.InvokeOutput, error)

func ListServicesForEcsCluster

func ListServicesForEcsCluster(awsSess *session.Session, cluster string) []*ecs.Service

func RightSizeAsgForEcsCluster

func RightSizeAsgForEcsCluster(awsSess *session.Session, cluster string, atLeastServiceDesiredCount bool) error

func UpdateAsgServerCount

func UpdateAsgServerCount(awsSess *session.Session, asgName string, serverCount int64) error

Types

type InstanceType

type InstanceType struct {
	MemoryMb int64
	CPUUnits int64
}

Jump to

Keyboard shortcuts

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