ecs

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2024 License: MIT Imports: 10 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(ctx context.Context) (*Client, error)

BuildDefaultClient provides new Client with default session config

func NewClient

func NewClient(cfg aws.Config) *Client

NewClient build a new Client out of a session

func (*Client) CopyTaskDefinition

func (client *Client) CopyTaskDefinition(ctx context.Context, service *types.Service) (*ecs.RegisterTaskDefinitionInput, *types.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 *types.Service, after *time.Time) ([]string, *time.Time, error)

GetRecentErrorMessages grabs the first task definition for a service

func (*Client) GetService

func (client *Client) GetService(ctx context.Context, clusterName string, serviceName string) (*types.Service, error)

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

func (*Client) GetTaskDefinition

func (client *Client) GetTaskDefinition(ctx context.Context, service *types.Service) (*types.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(ctx context.Context, service *types.Service) (bool, error)

LooksGood checks if a service looks good

func (*Client) RegisterTaskDefinition

func (client *Client) RegisterTaskDefinition(ctx context.Context, input *ecs.RegisterTaskDefinitionInput) (*types.TaskDefinition, error)

RegisterTaskDefinition Registers a task definition and returns it

func (*Client) UpdateTaskDefinition

func (client *Client) UpdateTaskDefinition(ctx context.Context, service *types.Service, task *types.TaskDefinition) (*types.Service, error)

UpdateTaskDefinition Registers a task definition and returns it

func (*Client) WaitUntilGood

func (client *Client) WaitUntilGood(ctx context.Context, service *types.Service, timeout *time.Duration) error

WaitUntilGood wait for a service to look good

type ContainerConfig

type ContainerConfig struct {
	CPU               *int32            `json:"cpu" yaml:"cpu"`
	Environment       map[string]string `json:"environment" yaml:"environment"`
	Image             *string           `json:"image" yaml:"image"`
	Memory            *int32            `json:"memory" yaml:"memory"`
	MemoryReservation *int32            `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 *int32, isNow *int32)

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 *int32, isNow *int32)

ChangeMemory register a change in memory

func (*ContainerConfigDiff) ChangeMemoryReservation

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

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