Code Monkey home page Code Monkey logo

going's Introduction

Going

Small CLI tool for working with AWS. This tool is mostly used to log in to ECS containers.

Usage

All commands will prompt for an AWS profile defined in the shared AWS config file $HOME/.aws/config. You can use the -p, --profile flag to specify a profile and not be prompted.

All prompts have fuzzy searching.

shell command

You can connect to an ECS container using the shell command. This command will make sure the cached SSO credentials are valid and if not will attempt to refresh them.

going shell -p staging

This will prompt you to select a cluster, service, task (if more than 1 is running), and a container.

If the ExecuteCommand agent isn't running in the container you can use the --ssm flag to use SSM directly.

Open a shell to a container in ECS

Usage:
  going shell [flags]

Flags:
  -c, --cluster string     The cluster name
  -r, --container string   The container name
  -h, --help               help for shell
  -s, --service string     The service name
      --ssm                Use SSM directly to get a shell

Global Flags:
  -p, --profile string   The AWS profile to use

logs command

This command lets you tail CloudWatch logs for a container. It uses the awslogs-group and awslogs-stream-prefix from the task definition to filter logs events which isn't perfect so YMMV.

The -t, --minutes flag will specify how many minutes back from now to filter logs (default of 30).

going logs -t 90

sso command

The sso command by itself will print the AWS access_key, secret_key, and token credentials. Adding the -e, --env flag will output the credentials as environment variables that can be pasted into a .env file.

This command has multiple sub-commands for login/logout and an automatic way of replacing AWS environment variables.

going sso --env

replace command

The replace command will try to replace the environment variables for the AWS credentials in .env files. The command takes either a list of files as positional arguments or if no flags exist it will try $PWD/.env.

going sso replace /project1/.env /project2/.env

The way this is done currently is pretty simple, it will only update keys that exist in the file and not add missing ones. The keys it updates are AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and AWS_SESSION_TOKEN.

login command

This command will perform a full SSO login, ignoring the cached SSO credentials.

going sso login

logout command

This command will perform a logout of the current SSO session by telling AWS to invalidate the session and deleting the cached credential file.

going sso logout

going's People

Contributors

afrase avatar

Stargazers

Jay Prall avatar Frank Kwok avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.