https://github.com/boltops-tools/aws-inventory
aws inventory tool
https://github.com/boltops-tools/aws-inventory
Last synced: about 1 year ago
JSON representation
aws inventory tool
- Host: GitHub
- URL: https://github.com/boltops-tools/aws-inventory
- Owner: boltops-tools
- License: mit
- Created: 2017-12-05T16:30:43.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-02-08T03:31:01.000Z (over 4 years ago)
- Last Synced: 2024-05-01T11:29:03.172Z (about 2 years ago)
- Language: Ruby
- Size: 79.1 KB
- Stars: 47
- Watchers: 6
- Forks: 18
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# AWS Inventory
[](https://www.boltops.com)
AWS Inventory tool. Useful to get summarized information on AWS account. The tool by default produces a report that can easily be read from a terminal, but it can also be used produce a tab separated output report that can be pasted into a spreadsheet and then copied to a report. This is controlled via a `AWS_INVENTORY_FORMAT` env variable and covered in the Format Options section.
## Usage
```sh
aws-inventory acm # report acm inventory
aws-inventory cfn # report cfn inventory
aws-inventory cw # report cloudwatch inventory
aws-inventory eb # report eb inventory
aws-inventory ec2 # report ec2 inventory
aws-inventory ecs # report ecs inventory
aws-inventory elb # report elb inventory
aws-inventory iam # report iam inventory
aws-inventory keypair # report keypair inventory
aws-inventory rds # report rds inventory
aws-inventory route53 # report route53 inventory
aws-inventory sg # report security group inventory
aws-inventory vpc # report vpc inventory
```
## Example
What the output looks something like:
```sh
$ aws-inventory ec2
+-------+-------------+---------------+----------+-----------------+
| Name | Instance Id | Instance Type | Platform | Security Groups |
+-------+-------------+---------------+----------+-----------------+
| name1 | i-123 | m3.medium | linux | sg-123 |
| name2 | i-456 | t2.small | linux | sg-456 |
+-------+-------------+---------------+----------+-----------------+
$
```
If you want to copy this to an spreadsheet, you can use the tab format. Here's an example with `pbcopy`:
```sh
export AWS_INVENTORY_FORMAT=tab
aws-inventory ec2 | pbcopy
```
### To Check Every Region for EC2 Instances
```sh
GREEN='\033[0;32m'
NC='\033[0m' # No Color
for i in $(aws ec2 describe-regions | jq -r '.Regions[].RegionName') ; do
echo -e "$GREEN$i$NC"
AWS_REGION=$i aws-inventory ec2
done
```
### Format Option
There are a few supported formats: tab, table and json. The default is table. To switch between formats use the AWS_INVENTORY_FORMAT environment variable.
```sh
export AWS_INVENTORY_FORMAT=tab
aws-inventory ec2
export AWS_INVENTORY_FORMAT=table
aws-inventory ec2
export AWS_INVENTORY_FORMAT=json
aws-inventory ec2
```
## Install
```sh
gem install aws-inventory
```
## Contributing
I love pull requests! Happy to answer questions to help.
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request