ecsta

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2022 License: MIT Imports: 25 Imported by: 3

README

ecsta

ecsta is a "ECS Task Assistant" tool.

Install

Homebrew
$ brew install fujiwara/tap/ecsta
Binary releases

Usage

Usage: ecsta <flags> <subcommand> <subcommand args>

Subcommands:
        configure        configure ecsta
        describe         describe task
        exec             exec task
        flags            describe all known top-level flags
        list             liste tasks
        portforward      port forwarding
        stop             stop task

Use "ecsta flags" for a list of top-level flags
Configuration

ecsta is a zero configuration command. But you can use a configuration file (~/.config/ecsta/config.json) to set default options.

Run an interactive setting as below.

$ ecsta configure
$ ecsta configure -show
2022/08/08 15:36:54 configuration file: /home/fujiwara/.config/ecsta/config.json
{
  "filter_command": "peco",
  "output": "tsv"
}
List tasks
$ ecsta list -h
list -cluster <cluster> [options]:
  Show task ARNs in the cluster.
  -family string
        task definition family
  -output string
        output format (table|json|tsv)
$ ecsta -cluster foo list
|                ID                |   TASKDEFINITION   | INSTANCE | LASTSTATUS | DESIREDSTATUS |         CREATEDAT         |        GROUP        |  TYPE   |
+----------------------------------+--------------------+----------+------------+---------------+---------------------------+---------------------+---------+
| 38b0db90fd4c4b5aaff29288b2179b5a | ecspresso-test:499 |          | RUNNING    | RUNNING       | 2022-08-05T09:59:27+09:00 | service:nginx-local | FARGATE |
| 4deeb701c49a4892b7de39a2d0df17e0 | ecspresso-test:499 |          | RUNNING    | RUNNING       | 2022-08-06T00:12:50+09:00 | service:nginx-local | FARGATE |
Describe task
describe [options]:
  Describe a task in a cluster.
  -id string
        task ID
Exec task
exec [options]:
  ECS Exec task in a cluster.
  -command string
        command (default "sh")
  -container string
        container name
  -id string
        task ID
Portfoward task

-port and -localport are required.

-host does not work currently. (ssm-agent version run by ECS Exec is too old)

portforward [options]:
  Port forwarding to a task in a cluster.
  -container string
        container name
  -host string
        remote host
  -id string
        task ID
  -localport int
        local port
  -port int
        remote port
Stop task
stop [options]:
  Stop task in a cluster.
  -force
        stop a task without confirmation
  -id string
        task ID

LICENSE

MIT

Documentation

Index

Constants

View Source
const SessionManagerPluginBinary = "session-manager-plugin"

Variables

View Source
var ConfigElements = []ConfigElement{
	{
		Name:        "filter_command",
		Description: "command to run to filter messages",
	},
	{
		Name:        "output",
		Description: "output format (table, tsv or json)",
	},
}
View Source
var ErrAborted = errors.New("Aborted")

Functions

This section is empty.

Types

type Config

type Config map[string]string

func (Config) Get

func (c Config) Get(name string) string

func (Config) Set

func (c Config) Set(name, value string)

func (Config) String

func (c Config) String() string

type ConfigElement

type ConfigElement struct {
	Name        string `json:"name"`
	Description string `json:"help"`
}

type ConfigureCmd

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

func NewConfigureCmd

func NewConfigureCmd(app *Ecsta) *ConfigureCmd

func (*ConfigureCmd) Execute

func (p *ConfigureCmd) Execute(ctx context.Context, f *flag.FlagSet, _ ...interface{}) subcommands.ExitStatus

func (*ConfigureCmd) Name

func (*ConfigureCmd) Name() string

func (*ConfigureCmd) SetFlags

func (p *ConfigureCmd) SetFlags(f *flag.FlagSet)

func (*ConfigureCmd) Synopsis

func (*ConfigureCmd) Synopsis() string

func (*ConfigureCmd) Usage

func (*ConfigureCmd) Usage() string

type DescribeCmd

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

func NewDescribeCmd

func NewDescribeCmd(app *Ecsta) *DescribeCmd

func (*DescribeCmd) Execute

func (p *DescribeCmd) Execute(ctx context.Context, f *flag.FlagSet, _ ...interface{}) subcommands.ExitStatus

func (*DescribeCmd) Name

func (*DescribeCmd) Name() string

func (*DescribeCmd) SetFlags

func (p *DescribeCmd) SetFlags(f *flag.FlagSet)

func (*DescribeCmd) Synopsis

func (*DescribeCmd) Synopsis() string

func (*DescribeCmd) Usage

func (*DescribeCmd) Usage() string

type Ecsta

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

func New

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

func (*Ecsta) Endpoint

func (app *Ecsta) Endpoint(ctx context.Context) (string, error)

func (*Ecsta) SetCluster

func (app *Ecsta) SetCluster(ctx context.Context) error

type ExecCmd

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

func NewExecCmd

func NewExecCmd(app *Ecsta) *ExecCmd

func (*ExecCmd) Execute

func (p *ExecCmd) Execute(ctx context.Context, f *flag.FlagSet, _ ...interface{}) subcommands.ExitStatus

func (*ExecCmd) Name

func (*ExecCmd) Name() string

func (*ExecCmd) SetFlags

func (p *ExecCmd) SetFlags(f *flag.FlagSet)

func (*ExecCmd) Synopsis

func (*ExecCmd) Synopsis() string

func (*ExecCmd) Usage

func (*ExecCmd) Usage() string

type ListCmd

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

func NewListCmd

func NewListCmd(app *Ecsta) *ListCmd

func (*ListCmd) Execute

func (p *ListCmd) Execute(ctx context.Context, f *flag.FlagSet, _ ...interface{}) subcommands.ExitStatus

func (*ListCmd) Name

func (*ListCmd) Name() string

func (*ListCmd) SetFlags

func (p *ListCmd) SetFlags(f *flag.FlagSet)

func (*ListCmd) Synopsis

func (*ListCmd) Synopsis() string

func (*ListCmd) Usage

func (*ListCmd) Usage() string

type PortforwardCmd

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

func NewPortforwardCmd

func NewPortforwardCmd(app *Ecsta) *PortforwardCmd

func (*PortforwardCmd) Execute

func (p *PortforwardCmd) Execute(ctx context.Context, f *flag.FlagSet, _ ...interface{}) subcommands.ExitStatus

func (*PortforwardCmd) Name

func (*PortforwardCmd) Name() string

func (*PortforwardCmd) SetFlags

func (p *PortforwardCmd) SetFlags(f *flag.FlagSet)

func (*PortforwardCmd) Synopsis

func (*PortforwardCmd) Synopsis() string

func (*PortforwardCmd) Usage

func (*PortforwardCmd) Usage() string

type StopCmd

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

func NewStopCmd

func NewStopCmd(app *Ecsta) *StopCmd

func (*StopCmd) Execute

func (p *StopCmd) Execute(ctx context.Context, f *flag.FlagSet, _ ...interface{}) subcommands.ExitStatus

func (*StopCmd) Name

func (*StopCmd) Name() string

func (*StopCmd) SetFlags

func (p *StopCmd) SetFlags(f *flag.FlagSet)

func (*StopCmd) Synopsis

func (*StopCmd) Synopsis() string

func (*StopCmd) Usage

func (*StopCmd) Usage() string

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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