Giter Site home page Giter Site logo

myaws's Introduction

MyAWS

A human friendly AWS CLI written in Go.

The official aws-cli is useful but too generic. It has many arguments and options and generates huge JSON outputs. But, in most cases, my interesting resources are the same. By setting my favorite default values, MyAWS provides a simple command line interface.

Note that MyAWS is under development and its interface is unstable.

Installation

If you are Mac OSX user:

$ brew install minamijoyo/myaws/myaws

or

If you have Go 1.13+ development environment:

$ go get github.com/minamijoyo/myaws

or

Download the latest compiled binaries and put it anywhere in your executable path.

https://github.com/minamijoyo/myaws/releases

Configuration

Required

MyAWS invokes AWS API call via aws-sdk-go. Export environment variables for your AWS credentials:

$ export AWS_ACCESS_KEY_ID=XXXXXX
$ export AWS_SECRET_ACCESS_KEY=XXXXXX
$ export AWS_DEFAULT_REGION=XXXXXX

or set your credentials in $HOME/.aws/credentials :

[default]
aws_access_key_id = XXXXXX
aws_secret_access_key = XXXXXX

or IAM Task Role (ECS) or IAM Role are also available.

AWS credentials are checked in the order of profile, environment variables, IAM Task Role (ECS), IAM Role. Unlike the aws default, load profile before environment variables because we want to prioritize explicit arguments over the environment.

AWS region can be set in Environment variable ( AWS_DEFAULT_REGION ), configuration file ( $HOME/.myaws.yaml ) , or command argument ( --region ).

Optional

Configuration file is optional.

MyAWS read default configuration from $HOME/.myaws.yml

A sample configuration looks like the following:

profile: default
region: ap-northeast-1
ec2:
  ls:
    all: false
    fields:
      - InstanceId
      - InstanceType
      - PublicIpAddress
      - PrivateIpAddress
      - StateName
      - LaunchTime
      - Tag:Name
      - Tag:attached_asg

Example

$ myaws ec2 ls
i-0f48fxxxxxxxxxxxx     t2.micro        52.197.xxx.xxx  10.193.xxx.xxx    running 1 minute ago    proxy
i-0e267xxxxxxxxxxxx     t2.medium       52.198.xxx.xxx  10.193.xxx.xxx    running 2 days ago      app
i-0fdaaxxxxxxxxxxxx     t2.large        52.197.xxx.xxx  10.193.xxx.xxx    running 1 month ago     batch

Usage

$ myaws --help
A human friendly AWS CLI written in Go.

Usage:
  myaws [command]

Available Commands:
  autoscaling Manage autoscaling resources
  completion  Generates shell completion scripts
  ec2         Manage EC2 resources
  ec2ri       Manage EC2 Reserved Instance resources
  ecr         Manage ECR resources
  ecs         Manage ECS resources
  elb         Manage ELB resources
  elbv2       Manage ELBV2 resources
  help        Help about any command
  iam         Manage IAM resources
  rds         Manage RDS resources
  ssm         Manage SSM resources
  sts         Manage STS resources
  version     Print version

Flags:
      --config string     config file (default $HOME/.myaws.yml)
      --debug             Enable debug mode
  -h, --help              help for myaws
      --humanize          Use Human friendly format for time (default true)
      --profile string    AWS profile (default none and used AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY environment variables.)
      --region string     AWS region (default none and used AWS_DEFAULT_REGION environment variable.
      --timezone string   Time zone, such as UTC, Asia/Tokyo (default "Local")

Use "myaws [command] --help" for more information about a command.
$ myaws ec2 ls --help
List EC2 instances

Usage:
  myaws ec2 ls [flags]

Flags:
  -a, --all                 List all instances (by default, list running instances only)
  -F, --fields string       Output fields list separated by space (default "InstanceId InstanceType PublicIpAddress PrivateIpAddress AvailabilityZone StateName LaunchTime Tag:Name")
  -t, --filter-tag string   Filter instances by tag, such as "Name:app-production". The value of tag is assumed to be a partial match
  -q, --quiet               Only display InstanceIDs

Global Flags:
      --config string     config file (default $HOME/.myaws.yml)
      --humanize          Use Human friendly format for time (default true)
      --profile string    AWS profile (default none and used AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY environment variables.)
      --region string     AWS region (default none and used AWS_DEFAULT_REGION environment variable.
      --timezone string   Time zone, such as UTC, Asia/Tokyo (default "Local")

LICENCE

MIT

myaws's People

Contributors

minamijoyo avatar kangaechu avatar akiray03 avatar h3poteto avatar

Watchers

James Cloos 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.