Skip to content

keidarcy/e1s

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

e1s

E1S - Easily Manage AWS ECS Resources in Terminal 🐱

e1s is a terminal application to easily browse and manage AWS ECS resources, supports both Fargate and EC2 ECS launch types. Inspired by k9s.

e1s-screenshot

A quick video demo

e1s-demo

AWS credentials and configuration

e1s uses the default aws-cli configuration. It does not store or send your access and secret key anywhere. The access and secret key are used only to securely connect to AWS API via AWS SDK. Both profile and region are overridable via the AWS_PROFILE, AWS_REGION prepend environment variable or --profile, --region option.

Installation

e1s is available on Linux, macOS and Windows platforms.

  • Binaries for Linux, Windows and Mac are available in the release page.
  • Homebrew for maxOS or Linux
  • Docker image
brew install keidarcy/tap/e1s
# brew upgrade
# brew upgrade keidarcy/tap/e1s
# docker image
# docker pull ghcr.io/keidarcy/e1s:latest

Usage

Make sure you have the AWS CLI installed and properly configured with the necessary permissions to access your ECS resources, and session manager plugin installed if you want to use the interactive exec or port forwarding features.

  • Usage of e1s:
$ e1s -h
e1s is a terminal application to easily browse and manage AWS ECS resources 🐱.
Check https://github.com/keidarcy/e1s for more details.

Usage:
  e1s [flags]

Flags:
  -c, --config-file string   config file (default "$HOME/.config/e1s/config.yml")
  -d, --debug                sets debug mode
  -h, --help                 help for e1s
  -j, --json                 log output json format
  -l, --log-file string      specify the log file path (default "${TMPDIR}e1s.log")
      --profile string       specify the AWS profile
      --read-only            sets read only mode
  -r, --refresh int          specify the default refresh rate as an integer, sets -1 to stop auto refresh (sec) (default 30)
      --region string        specify the AWS region
  -s, --shell string         specify interactive ecs exec shell (default "/bin/sh")
      --theme string         specify color theme
  -v, --version              version for e1s
  • Examples
# use all default config
$ e1s
# use custom-profile profile, us-east-2 region
$ AWS_PROFILE=custom-profile AWS_REGION=us-east-2 e1s
# use custom-profile profile, us-east-2 region
$ e1s --profile custom-profile --region us-east-2
# use command line to set read only, debug, stop auto refresh with a custom log path json output and dracula theme
$ e1s --readonly --debug --refresh -1 --log-file /tmp/e1s.log --json --theme dracula
# docker run with specified profile and region
$ docker run -it --rm -v $HOME/.aws:/root/.aws ghcr.io/keidarcy/e1s:latest e1s --profile YOUR_PROFILE --region YOUR_REGION

Config file(sample)

Default config file path is $HOME/.config/e1s/config.yml, it's possible specify the config file that viper supports with --config-file option.

Theme and colors

Theme and colors can be specified by options or config file. Full themes list can be found here. If you prefer to use your own color theme, you can specify the colors in the config file.

examples
  • command e1s --theme dracula
  • screenshot

theme-dracula

  • config file
colors:
  BgColor: "#272822"
  FgColor: "#f8f8f2"
  BorderColor: "#a1efe4"
  Black: "#272822"
  Red: "#f92672"
  Green: "#a6e22e"
  Yellow: "#f4bf75"
  Blue: "#66d9ef"
  Magenta: "#ae81ff"
  Cyan: "#a1efe4"
  Gray: "#808080"
  • screenshot

theme-hex

  • config file
colors:
  BgColor: black
  FgColor: cadeblue
  BorderColor: dodgerblue
  Black: black
  Red: orangered
  Green: palegreen
  Yellow: greenyellow
  Blue: darkslateblue
  Magenta: mediumpurple
  Cyan: lightskyblue
  Gray: lightslategray
  • screenshot

theme-w3c

Key bindings

Press ? to check overall key bindings, top right corner to check current resource specific hot keys.

help

help

Development

go run cmd/e1s/main.go --debug --log-file /tmp/e1s.log
tail -f /tmp/e1s.log

Features

Full features list

features
  • config file
  • Read only mode
  • Auto refresh
  • Describe clusters
  • Describe services
  • Describe tasks(running, stopped)
  • Describe containers
  • Describe task definitions
  • Describe service autoscaling
  • Show cloudwatch logs(only support awslogs logDriver)
    • Realtime log streaming(only support one log group)
  • Show Metrics
    • CPUUtilization
    • MemoryUtilization
  • Show autoscaling target and policy
  • Open selected resource in browser(support new UI(v2))
  • Interactively exec towards containers(like ssh)
  • Edit service
    • Desired count
    • Force new deployment
    • Task definition family
    • Task definition revision
  • Stop task
  • Register new task definition
  • Start port forwarding session
  • Start remote host port forwarding session
  • Transfer files to and from your local machine and a remote host like aws s3 cp
  • Customize theme
  • Customize colors

Interactively exec towards containers(ECS Exec)

Use aws-ecs-exec-checker to check for the pre-requisites to use ECS exec.

interactive exec demo

e1s-interactive-exec-demo

Use ctrl + d to exit interactive-exec session.

Troubleshooting

The execute command failed because execute command... - check service execute command, task role policy

Session Manager plugin not found - document.

update service demo

update-service-demo

  • Force new deployment
  • Desired tasks
  • Task definition family
  • Task definition revision
Register task definition

register-task-definition-demo

With a specified task and container, to start port forwarding session you need to specify a port and a local port. The local port is the port on your local machine that you want to use to access the container port.

Port forwarding session

port-forwarding-session-demo

With a specified task and container, to start a remote host port forwarding session you need to specify a port, a host and a local port. The local port is the port on your local machine that you want to use to access the remote host port though container.

Remote host port forwarding session

remote-host-port-forwarding-session-demo

File transfer

Implemented by a S3 bucket. Since file transfer though a S3 bucket and aws-cli in container, you need a S3 bucket and add permissions S3 bucket permission to the task role and e1s role, and also need a aws-cli installed container.

File transfer

file-transfer-demo

Feature requests & bug reports

If you have any feature requests or bug reports, please submit them through GitHub Issues.

Publish new version

  • Bump version
  • make tag

Thanks

License

MIT