ecs

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client thin wrapper around ecs

func BuildDefaultClient

func BuildDefaultClient() *Client

BuildDefaultClient provides new Client with default session config

func NewClient

func NewClient(session *session.Session) *Client

NewClient build a new Client out of a session

func (*Client) CopyTaskDefinition

func (client *Client) CopyTaskDefinition(service *ecs.Service) (*ecs.RegisterTaskDefinitionInput, *ecs.TaskDefinition, error)

CopyTaskDefinition grabs the first task definition for a service & make copy of it NOTE: Tags are in the top level of the task definition output we need those for later

func (*Client) GetRecentErrorMessages

func (client *Client) GetRecentErrorMessages(service *ecs.Service, after *time.Time) ([]string, *time.Time, error)

GetRecentErrorMessages grabs the first task definition for a service

func (*Client) GetService

func (client *Client) GetService(clusterName string, serviceName string) (*ecs.Service, error)

GetService grabs the first service matching the provided cluster and service names

func (*Client) GetTaskDefinition

func (client *Client) GetTaskDefinition(service *ecs.Service) (*ecs.TaskDefinition, error)

GetTaskDefinition grabs the first task definition for a service NOTE: Tags are in the top level of teh task definition output we need those for later

func (*Client) LooksGood

func (client *Client) LooksGood(service *ecs.Service) (bool, error)

LooksGood checks if a service looks good

func (*Client) RegisterTaskDefinition

func (client *Client) RegisterTaskDefinition(input *ecs.RegisterTaskDefinitionInput) (*ecs.TaskDefinition, error)

RegisterTaskDefinition Registers a task definition and returns it

func (*Client) UpdateTaskDefinition

func (client *Client) UpdateTaskDefinition(service *ecs.Service, task *ecs.TaskDefinition) (*ecs.Service, error)

UpdateTaskDefinition Registers a task definition and returns it

func (*Client) WaitUntilGood

func (client *Client) WaitUntilGood(service *ecs.Service, timeout *time.Duration) error

WaitUntilGood wait for a service to look good

type ContainerConfig

type ContainerConfig struct {
	CPU               *int64            `json:"cpu" yaml:"cpu"`
	Environment       map[string]string `json:"environment" yaml:"environment"`
	Image             *string           `json:"image" yaml:"image"`
	Memory            *int64            `json:"memory" yaml:"memory"`
	MemoryReservation *int64            `json:"memoryReservation" yaml:"memoryReservation"`
}

ContainerConfig represents changes we can make to containers

func (*ContainerConfig) ApplyTo

ApplyTo apply a config to a container definition

type ContainerConfigDiff

type ContainerConfigDiff struct {
	CPU               *IntegerDiff           `json:"cpu"`
	Environment       map[string]*StringDiff `json:"environment"`
	Image             *StringDiff            `json:"image"`
	Memory            *IntegerDiff           `json:"memory"`
	MemoryReservation *IntegerDiff           `json:"memoryReservation"`
}

ContainerConfigDiff all the changes in a task definition

func (*ContainerConfigDiff) ChangeCPU

func (diff *ContainerConfigDiff) ChangeCPU(was *int64, isNow *int64)

ChangeCPU register a change in cpu

func (*ContainerConfigDiff) ChangeEnvironment

func (diff *ContainerConfigDiff) ChangeEnvironment(variable string, was *string, isNow *string)

ChangeEnvironment register a change in environment variables

func (*ContainerConfigDiff) ChangeImage

func (diff *ContainerConfigDiff) ChangeImage(was *string, isNow *string)

ChangeImage register a change in the image

func (*ContainerConfigDiff) ChangeMemory

func (diff *ContainerConfigDiff) ChangeMemory(was *int64, isNow *int64)

ChangeMemory register a change in memory

func (*ContainerConfigDiff) ChangeMemoryReservation

func (diff *ContainerConfigDiff) ChangeMemoryReservation(was *int64, isNow *int64)

ChangeMemoryReservation register a change in memory reservation

func (*ContainerConfigDiff) Empty

func (diff *ContainerConfigDiff) Empty() bool

Empty check if there's no change on the container config

func (*ContainerConfigDiff) String

func (diff *ContainerConfigDiff) String() string

type IntegerDiff

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

IntegerDiff represents a difference on an integer value

func (*IntegerDiff) Empty

func (diff *IntegerDiff) Empty() bool

Empty check if there's no change on the value

func (*IntegerDiff) String

func (diff *IntegerDiff) String() string

type StringDiff

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

StringDiff represents a difference on an integer value

func (*StringDiff) Empty

func (diff *StringDiff) Empty() bool

Empty check if there's no change on the value

func (*StringDiff) String

func (diff *StringDiff) String() string

type TaskConfig

type TaskConfig struct {
	CPU                  *string                    `json:"cpu" yaml:"cpu"`
	Memory               *string                    `json:"memory" yaml:"memory"`
	ContainerDefinitions map[string]ContainerConfig `json:"containerDefinitions" yaml:"containerDefinitions"`
}

TaskConfig represents changes we can make to task definitions

func (*TaskConfig) ApplyTo

ApplyTo apply a config to register task definition input

type TaskConfigDiff

type TaskConfigDiff struct {
	CPU                  *StringDiff                     `json:"cpu"`
	Memory               *StringDiff                     `json:"memory"`
	ContainerDefinitions map[string]*ContainerConfigDiff `json:"containerDefinitions"`
}

TaskConfigDiff all the changes in a task definition

func (*TaskConfigDiff) ChangeCPU

func (diff *TaskConfigDiff) ChangeCPU(was *string, isNow *string)

ChangeCPU register a change in cpu

func (*TaskConfigDiff) ChangeContainer

func (diff *TaskConfigDiff) ChangeContainer(name string, containerDiff *ContainerConfigDiff)

ChangeContainer updates a container diff

func (*TaskConfigDiff) ChangeMemory

func (diff *TaskConfigDiff) ChangeMemory(was *string, isNow *string)

ChangeMemory register a change in memory

func (*TaskConfigDiff) Empty

func (diff *TaskConfigDiff) Empty() bool

Empty check if there's no change on the task definition config

func (*TaskConfigDiff) String

func (diff *TaskConfigDiff) String() string

Jump to

Keyboard shortcuts

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