README
¶
awsops
A Go based CLI and Serverless functions for common AWS operations
This library is a bit scrappy and very opinionated for executing operational processes on AWS the way we like to.
Installation
If you don't care to modify the source, you can grab a prebuilt binary from the dist/ folder for your
platform and run it directly.
You can also clone this repo and use go build or go run from the cli/ folder to run it.
Configuration
This app makes use of the AWS Go SDK - https://docs.aws.amazon.com/sdk-for-go/api/
This library makes use of standard AWS CLI configurations such as the ~/.aws/credentials file. If you don't already use the AWS CLI, the easiest way to configure your system is to create a .aws folder in your home directory and a credentials file inside that directory. The format of the file should be:
[nameofprofile]
aws_access_key_id = value
aws_secret_access_key = value
Then when using awsops you can use the -p flag followed by whatever profile from the credentials file you want to use. For example: awsops -p default ...
Usage
$ awsops
Utility app for common operational tasks for AWS
Usage:
awsops [command]
Available Commands:
ecs ECS related actions, run 'awsops ecs' to view list of subcommands
help Help about any command
Flags:
--config string config file (default is $HOME/.awsops.yaml)
-h, --help help for awsops
-p, --profile string AWS shared credentials profile to use
-r, --region string AWS shared credentials profile to use (default "us-east-1")
-t, --toggle Help message for toggle
Use "awsops [command] --help" for more information about a command.
$ awsops ecs
ECS related actions, run 'awsops ecs' to view list of subcommands
Usage:
awsops ecs [flags]
awsops ecs [command]
Available Commands:
listInstanceIPs List Instance IPs for ECS Cluster
replaceInstances Gracefully replace EC2 instances for given ECS cluster
rightSizeCluster Scale ASG for ECS cluster to minimum needed servers
Flags:
-c, --cluster string ECS cluster name
-h, --help help for ecs
Global Flags:
--config string config file (default is $HOME/.awsops.yaml)
-p, --profile string AWS shared credentials profile to use
-r, --region string AWS shared credentials profile to use (default "us-east-1")
Use "awsops ecs [command] --help" for more information about a command.
$ awsops ecs listInstanceIPs --help
Command returns a space separated list of IP addresses for instances in an ECS cluster
Usage:
awsops ecs listInstanceIPs [flags]
Flags:
-h, --help help for listInstanceIPs
Global Flags:
-c, --cluster string ECS cluster name
--config string config file (default is $HOME/.awsops.yaml)
-p, --profile string AWS shared credentials profile to use
-r, --region string AWS shared credentials profile to use (default "us-east-1")
$ awsops ecs replaceInstances --help
Gracefully replace EC2 instances for given ECS cluster
Usage:
awsops ecs replaceInstances [flags]
Flags:
-h, --help help for replaceInstances
Global Flags:
-c, --cluster string ECS cluster name
--config string config file (default is $HOME/.awsops.yaml)
-p, --profile string AWS shared credentials profile to use
-r, --region string AWS shared credentials profile to use (default "us-east-1")
$ awsops ecs rightSizeCluster --help
This command calculates total memory and CPU needed
for all services in the given ECS cluster and then adjusts
instance count in the ASG based on instance type/size to
support running all tasks with as few servers as is needed.
This function may scale a cluster up or down depending on services.
Usage:
awsops ecs rightSizeCluster [flags]
Flags:
-h, --help help for rightSizeCluster
Global Flags:
-c, --cluster string ECS cluster name
--config string config file (default is $HOME/.awsops.yaml)
-p, --profile string AWS shared credentials profile to use
-r, --region string AWS shared credentials profile to use (default "us-east-1")
GPG Public Key
Binaries for awsops are also signed for you to verify it is from us. Our public GPG key is:
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBFt7Ku8BEAC5BEsVHEhXyISZc9QqGpJz2vbJ3NxMP3QsdLGtJo3nT8VClO7a
VWusTPy7eIgLfPX53OsFt++TiV/OFgjQHthvaQWtbOfvViwHz1Okn8/cZhQbhHkw
Miimv3w/zqADhE+TAkk8RIc9EC9nSIPgMjFP5w/K6BjIGTYXtgexDvik0/g1u63a
eRauZUvksABAvZn+i/O8fwsrfeDHTvhU8HpERWv4y6iDocAU8AZdB7s66sHNeJzE
usU0u1I3OLwo7ds5OlGiecltcDqVr/Nx1W1wuHbLDOPLLhlbK0WCiV38YTWRh3Ii
U5Dh2EYFo+2ujpiI2ftA8B1SwXIDgq1pisrY6H9pVWWsqEY+yv5EwqmcSPRYJ/2C
ykTG+iwbjt181m2suLof9n3Q9/fXYnbZ/x3Wsz3zT0NQIU3zCRrH5buD/N+GErIq
JZUk1A1Kx2nDfEQAvzSznFZmlHdc/86LloCZGiaFJ7OCRUCD2VHz1fqFTrladPIG
0EFdASgEjslq+8+WHLuihwgJFjTGw2anmFXyyIoqJJbJF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j8aKE0P7E1n/O9PI
Z4WwfzsNCVUMeCspWzfgB44Og8vmJD9hamQp26bDCtxiCS8ai9HVApnTJiTa6eaF
uTlNr1jcl0iTddRW4+nKkICTSTijEgtr98iaHNW51GG8lIGFZov/RPQmnZ1xnqYu
hFbRYFRZh1Bor0+cAsa3X3okugScPf4uG0o8XUQV7PCGg6Ie+4Y1Dk+hYnCQtxjR
7B1oBLdfcf1GR88RYXpeyCShr5dl5V9BudzcJjMcbvISAAklmJJz/xVNPsbWyouD
x/2vwNgKlFWr68smFLupuf4qCMmVU516RUfmg/JDbKovsd6DRHVizfVp8jes
=b8aO
-----END PGP PUBLIC KEY BLOCK-----
Download Binaries
If you prefer not to build/compile this source yourself, you can find prebuilt binaries for several platforms at: https://silintl-awsops-download.s3.amazonaws.com/index.html
Documentation
¶
There is no documentation for this package.