ecsclient

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ECSClient

type ECSClient struct {
	Backoff *backoff.Backoff
	Flags   Flags
	Svc     ECSSvc
}

ECSClient is the object through which the `ecs-task` command interacts with AWS.

func NewECSClient

func NewECSClient() *ECSClient

NewECSClient creates an ECSClient and returns a pointer to it.

func (*ECSClient) CleanupTaskDefinitions

func (e *ECSClient) CleanupTaskDefinitions() error

CleanupTaskDefinitions defines the overarching logic workflow for cleaning up task definitions.

func (*ECSClient) CollectClusters

func (e *ECSClient) CollectClusters() ([]string, error)

CollectClusters gathers the ARNs of all the clusters for the configured account and region.

func (*ECSClient) CollectServices

func (e *ECSClient) CollectServices(clusterARNs []string) (map[string][]string, error)

CollectServices gathers the ARNs of all the services associated with the clusters that are passed in for the configured account and region.

func (*ECSClient) CollectTaskDefinitions

func (e *ECSClient) CollectTaskDefinitions() ([]string, error)

CollectTaskDefinitions gathers the ARNs of all the task definitions for the configured account and region.

func (*ECSClient) ConfigureSession

func (e *ECSClient) ConfigureSession() error

ConfigureSession configures and instantiates an `ecs.ECS` object into the ECSClient's `Svc` field. This `ecs.ECS` object satisfies the `ECSSvc` interface defined in this package.

func (*ECSClient) DeregisterTaskDefinitions

func (e *ECSClient) DeregisterTaskDefinitions(taskDefinitionARNs []string) error

DeregisterTaskDefinitions creates a stack of ARNs and handles calling ecs.DeregisterTaskDefinition() for all these ARNs.

func (*ECSClient) DescribeServices

func (e *ECSClient) DescribeServices(serviceARNsByClusterARN map[string][]string) ([]ecs.Service, error)

DescribeServices compiles a list of `ecs.Service` objects given a map of cluster ARNs to lists of service ARNs associated with each cluster. Most importantly, these `ecs.Service` objects contain the ARNs of the task definitions currently in use by the services.

func (*ECSClient) FilterTaskDefinitions

func (e *ECSClient) FilterTaskDefinitions(allTaskDefinitionARNs []string, ecsServices []ecs.Service) ([]string, error)

FilterTaskDefinitions takes a master list of task definition ARNs and returns a version of that list from which has been removed:

  • All task definitions curently in use by a service.
  • All task definitions which are among the `n`-most-recently-used task definitions for each family. `n` is configured via the `--cutoff` flag.

type ECSSvc

ECSSvc defines the methods that an object must have in order to be used as the `Svc` object in the ECSClient. The AWS `ecs.ECS` object satisfies this interface.

type FailedDeregistration

type FailedDeregistration struct {
	Arn string
	Err error
}

FailedDeregistration is a struct that couples a task definition deregistration error to the ARN of the task definition.

type Flags

type Flags struct {
	Apply   bool
	Cutoff  int
	Debug   bool
	Quiet   bool
	Verbose bool
}

Flags hold user-defined operational parameters for the ECSClient. They are specified at the command line when `go-ecs-client ecs-task` is run.

Jump to

Keyboard shortcuts

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