tdrm

package module
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2024 License: MIT Imports: 20 Imported by: 0

README

tdrm

A command line tool to clean up Amazon ECS task definitions.

This tool works like this:

  • Keep n active revisions.
  • Inactivate revisions other than revisions to keep.
  • Delete inactive revisions.

This tool is heavily inspired by tdtidy and ecrm.

Usage

NAME:
   tdrm - A command line tool to manage AWS ECS task definitions

USAGE:
   tdrm [global options] command [command options]

VERSION:
   current

COMMANDS:
   delete   Delete task definitions.
   plan     List task definitions to delete.
   help, h  Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --config FILE, -c FILE  Load configuration from FILE (default: "tdrm.yaml") [$TDRM_CONFIG]
   --format value          plan output format (table, json) (default: "table") [$TDRM_FORMAT]
   --help, -h              show help
   --version, -v           print the version

Configurations

Configuration file is YAML format.The default file name is tdrm.yaml.

task_definitions:
  - family_prefix: metabase
    keep_count: 10
  - family_prefix: foo*
    keep_count: 20
  - family_prefix: bar*
    keep_count: 30

Author

Copyright (c) 2024 Gosuke Miyashita

LICENSE

MIT

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

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

func New

func New(ctx context.Context, region string) (*App, error)

func (*App) NewCLI

func (app *App) NewCLI() *cli.App

func (*App) NewDeleteCommand

func (app *App) NewDeleteCommand() *cli.Command

func (*App) NewPlanCommand

func (app *App) NewPlanCommand() *cli.Command

func (*App) Run

func (app *App) Run(ctx context.Context, path string, opt Option) error

type Config

type Config struct {
	TaskDefinitions []*TaskdefConfig `yaml:"task_definitions"`
}

func LoadConfig

func LoadConfig(path string) (*Config, error)

type Option

type Option struct {
	Delete bool
	Force  bool
	Format outputFormat
}

type Summary

type Summary struct {
	TaskDefinition    string `json:"task_definition"`
	ActiveRevisions   int    `json:"active_revisions"`
	InactiveRevisions int    `json:"inactive_revisions"`
	ToInactive        int    `json:"to_inactive"`
	ToDelete          int    `json:"to_delete"`
	Keep              int    `json:"keep"`
}

type SummaryTable

type SummaryTable []*Summary

type TaskDefinition

type TaskDefinition struct {
	Family     string
	ToInactive []string
	ToDelete   []string
}

type TaskdefConfig

type TaskdefConfig struct {
	FamilyPrefix *string `yaml:"family_prefix,omitempty"`
	KeepCount    *int    `yaml:"keep_count,omitempty"`
}

Jump to

Keyboard shortcuts

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