awsinfo
is a read-only client for AWS written in Bash. It tries to replace the AWS console for getting basic information about your AWS resoures in your CLI. No more opening the AWS Console when all you want to know is basic information about your resources.
When we try to get the most out of AWS by building on top of as many AWS services as possible we regularly have to look up information about our resources. From checking the deploment status of a CloudFormation stack to the number of messages in an SQS Queue, the status of a CodeBuild Project or the number of EC2 instances currently running.
Looking up this information often requires us to go through the AWS Console as the CLI tooling that AWS provides is a great interface to their API, but hard to use for getting an overview on deployed resources quickly. awsinfo
provides you with default views, similar to the AWS Console, for various (and growing) AWS services so you can get the most important information. While awsinfo
provides you with some access to deeper information on specific services, for the most part once you want to dig really deep other tools like the awscli
or aws-shell
are great for exploring all the details.
Terminals are the most common piece of tech we all use, regardless of the specific language we prefer. By building awsinfo
as a collection of bash scripts you can easily see and understand how it works under the hood. If it doesn’t do exactly what you need it to do you can copy the script, edit it to do exactly what you need and add that to your repository or local bash.
This is much more complicated if this tool were built on any specific programming language as we’d have to understand a lot more of the environment to get it up and running.
Building it with Bash also means we can use the awscli
directly which removes a lot of necessary implementation.
You can run AWSInfo either directly as a script or install through Docker.
On OSX you need to make sure that you have a recent version of Bash (>4) and the GNU coreutils installed, specifically greadlink
and gdate
. You can install them for example with brew install bash coreutils
. On Linux this should just work.
After that clone the Repository and either softlink the scripts/awsinfo.bash
script or put it in your Path. You can then directly execute the script as it automatically detects the path it was cloned into. For updates just pull from the Repository.
On Linux or Windows Subsystem for Linux, you might want to clone the repo to /usr/local/bin/awsinfo.git
or $HOME/bin/awsinfo.git
and then cd /usr/local/bin && ln -s awsinfo.git/scripts/awsinfo.bash awsinfo
or cd $HOME/bin && ln -s awsinfo.git/scripts/awsinfo.bash awsinfo
.
AWSInfo needs the following tools installed on your system:
You can use the following command to use the awsinfo
Docker container with pure Docker. It will automatically download it and run the container for you with any Arguments you append at the end. It makes the ~/.aws
folder accessible as a Volume as well as forwarding all awscli
default environment variables.
docker run -it -v ~/.aws:/root/.aws -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY -e AWS_SESSION_TOKEN -e AWS_DEFAULT_REGION -e AWS_PROFILE -e AWS_CONFIG_FILE -e AWSINFO_DEBUG theserverlessway/awsinfo ARGUMENTS_FOR_AWSINFO
You can set it up as an alias in your shell config file as well.
alias awsinfo='docker run -it -v ~/.aws:/root/.aws -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY -e AWS_SESSION_TOKEN -e AWS_DEFAULT_REGION -e AWS_PROFILE -e AWS_CONFIG_FILE -e AWSINFO_DEBUG theserverlessway/awsinfo'
If you’re using Whalebrew(Which I highly recommend) simply run the following to install:
whalebrew install theserverlessway/awsinfo
To update the Docker container run docker pull theserverlessway/awsinfo:latest
awsinfo
commands support commands and subcommands, for example you can run awsinfo logs
to print log messages
or awsinfo logs groups
to get a list of all log groups in the current account and region.
To see all supported services check out the following list or run awsinfo commands
.
You can see all the available commands for a service by running awsinfo commands SERVICE
, e.g.
awsinfo commands ec2
.
You can run any command with --help
(e.g. awsinfo logs --help
) to see the same help
page that is in the repo (and linked below).
You can list all supported services with awsinfo commands
and get a list of all commands per service with awsinfo command SERVICE
, e.g. awsinfo command ec2
Following is a list of all available commands and links to their source documentation files that are also used when you call a command with --help
acm
acm certificate
appautoscaling
appautoscaling policies
appautoscaling policy
appautoscaling schedules
appautoscaling targets
appsync
appsync datasources
appsync resolvers
appsync schema
appsync types
assume
assume role
assume token
autoscaling
autoscaling group
batch
batch compute-environment
batch compute-environments
batch job-queues
batch jobs
budgets
budgets budget
cloudformation
cloudformation change-set
cloudformation change-sets
cloudformation events
cloudformation exports
cloudformation imports
cloudformation outputs
cloudformation policy
cloudformation resources
cloudformation stack
cloudformation stack-set
cloudformation stack-set-instances
cloudformation stack-set-operations
cloudformation stack-set-template
cloudformation stack-sets
cloudformation template
cloudfront
cloudfront distribution
cloudfront origins
cloudwatch alarms
codebuild
codebuild build
codebuild builds
codecommit
codecommit branches
codecommit pull-request
codecommit pull-requests
codecommit repository
codepipeline
codepipeline executions
cognito
cognito clients
cognito users
commands
complete
complete zsh
costs
costs service
costs services
costs usage
credentials
dynamodb
dynamodb table
ec2
ec2 images
ec2 instance
ec2 keys
ecr
ecr images
ecs
ecs instance
ecs instances
ecs service
ecs service-events
ecs services
ecs task
ecs task-definition
ecs task-definitions
ecs task-families
ecs tasks
efs
efs file-system
efs mount-targets
efs security-groups
elasticbeanstalk
elasticbeanstalk applications
elasticbeanstalk events
elasticbeanstalk health
elasticbeanstalk instances
elasticbeanstalk stacks
elasticbeanstalk versions
elb
elb listener
elb listener-certificates
elb listeners
elb old
elb rules
elb target-group
elb target-groups
elb targets
es
es domain
events
events targets
firehose
firehose stream
iam
iam attached-group-policies
iam attached-role-policies
iam attached-user-policies
iam aws-policies
iam group-policies
iam group-policy
iam groups
iam instance-profiles
iam keys
iam keys-last-used
iam mfa
iam password-policy
iam policies
iam policy-version
iam role
iam role-policies
iam role-policy
iam roles
iam saml-provider
iam saml-providers
iam user
iam user-policies
iam user-policy
iam users
kms
kms aliases
kms policies
kms policy
lambda
lambda code
lambda function
logs
logs export-tasks
logs groups
logs streams
me
orgs
rds
rds cluster
rds clusters
rds engine-versions
rds events
rds instance
route53
route53 records
s3
s3 acl
s3 encryption
s3 lifecycle
s3 location
s3 notifications
s3 objects
s3 policy
s3 website
secretsmanager
secretsmanager policy
secretsmanager secret
secretsmanager value
ses
sns
sns subscriptions
sqs
ssm
ssm instance-associations
ssm parameter
ssm parameters
ssm session
version
vpc
vpc endpoints
vpc endpoints-available
vpc nat-gateways
vpc network-acl
vpc network-acls
vpc network-interface
vpc network-interfaces
vpc peering-connections
vpc route-table
vpc route-tables
vpc security-group
vpc security-groups
vpc subnet
vpc subnets