maws

package module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: May 28, 2021 License: MIT Imports: 18 Imported by: 0

README

maws-cli

maws is a multipex wrapper for aws cli.

maws works as below.

  1. Read a config file.
  2. Assume role to roles in the config.
  3. Run aws command with these assumed roles.

Install

Homebrew (macOS and Linux)
$ brew install fujiwara/tap/maws-cli
Binary packages

Releases

Usage

$ maws -h
Usage of maws:
  -buffering
        buffering stdout of aws cli (default true)
  -config string
        path of a config file (default "maws.yaml")
  -debug
        enable debug log
  -max-parallels int
        max parallels (default 10)
  -version
        show version

maws.yaml

roles:
  - arn:aws:iam::123456789012:role/Foo
  - arn:aws:iam::012345678901:role/Bar
allowed_command_prefixes:
  - get-
  - ls
$ maws -config maws.yaml sts get-caller-identity
2021/05/21 17:15:48 [debug] assume role to arn:aws:iam::123456789012:role/Foo
2021/05/21 17:15:48 [debug] assume role to arn:aws:iam::012345678901:role/Bar
2021/05/21 17:15:48 [debug] ASIARSLAYHAF7LL4K4O2 [sts get-caller-identity]
2021/05/21 17:15:48 [debug] ASIA6MF6NY4IKWGJUVVP [sts get-caller-identity]
{
    "UserId": "AROAJPKWIXB7ME2EZEO3G:maws-1621584948",
    "Account": "314472643515",
    "Arn": "arn:aws:sts::123456789012:assumed-role/Foo/maws-1621584948"
}
{
    "UserId": "AROA6MF6NY4INNOYY5GST:maws-1621584948",
    "Account": "988241839888",
    "Arn": "arn:aws:sts::012345678901:assumed-role/Bar/maws-1621584948"
}

LICENSE

MIT

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultAllowedCommandPrefixes = []string{
	"list-",
	"get-",
	"describe-",
}

Functions

func Run

func Run(ctx context.Context, opt Option) (int64, error)

Types

type Config

type Config struct {
	Roles                  []string `yaml:"roles"`
	AllowedCommandPrefixes []string `yaml:"allowed_command_prefixes"`
}

func LoadConfig

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

type Option

type Option struct {
	Config       string
	MaxParallels int64
	BufferStdout bool
	Commands     []string
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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