AWS Auto Inventory allows you to quickly and easily generate inventory reports of your AWS resources.

Overview

Photo by Denny Müller on Unsplash

Photo by Denny Müller on Unsplash

AWS Automated Inventory ( aws-auto-inventory )

Automates creation of detailed inventories from AWS resources.

Table of Contents


Screenshots


Expand
how-to-run
How to run
ec2-inventory-result
EC2 Inventory Result

Usage


Expand
aws-auto-inventory --help
usage: aws-auto-inventory [-h] --name NAME

Automates creation of detailed inventories from AWS resources.

optional arguments:
  -h, --help            show this help message and exit
  --name NAME, -n NAME  inventory name

Problem

Projects usually have several resources and fetching all the information about these resources manually is a very time-consuming task. This issue is intensified when the same project have multiple account and/or environments, e.g.: NonProd, QA and/or Prod.

Solution

Provide a simple way to fetch the required information and generate a spreadsheet. The information can be filtered, e.g. filter results by tag:x, vpc, subnets, etc. Additionally, inventories can be generated related to many services, which are collected and organized per sheet in the spreadsheet.

Development

# Linux/MacOS:
# clone the project and enter cloned directory
make init build
./dist/aws-auto-inventory --name <your-inventory-name>

Installing


Expand

You will need to create a config.yaml file in order to tell the tool how to generate your inventory, here are the default search paths for each platform:

  • OS X: ~/.config/aws-auto-inventory/config.yaml or ~/Library/Application Support/aws-auto-inventory/config.yaml
  • Other Unix: $XDG_CONFIG_HOME/aws-auto-inventory/config.yaml or ~/.config/aws-auto-inventory/config.yaml
  • Windows: %APPDATA%\aws-auto-inventory\config.yaml where the APPDATA environment variable falls back to %HOME%\AppData\Roaming\config.yaml if undefined

You can use the config-sample as an example. A snippet can be found below:

inventories:
  - name: your-inventory-name
    aws:
      profile: your-aws-profile
      region:
        - us-east-1
    excel:
      transpose: true
    sheets:
      - name: EC2 # sheet name on Excel
        service: ec2 # the boto3 client of an AWS service
        function: describe_instances # the client method of the service defined above
        result_key: Reservations # [optional]: The first key of the response dict
      - name: EBS
        service: ec2
        function: describe_volumes
        result_key: Volumes

If you are interested in building an inventory for multiple AWS Accounts (within your AWS organization) with the same sheets, you can use the config-sample-for-organization for simplicity. Code snippet:

Sheets: &sheets
  - name: CloudFrontDistros
    service: cloudfront
    function: list_distributions
    result_key: DistributionList
  - name: S3Buckets
    service: s3
    function: list_buckets
    result_key: Buckets

inventories:
  - name: your-org-master
    aws:
      profile: your-org
      region:
        - us-east-1
    excel:
      transpose: true
    sheets: *sheets

  - name: your-org-account1
    aws:
      profile: your-org-account1
      region:
        - us-east-1
    excel:
      transpose: true
    sheets: *sheets

  - name: your-org-account2
    aws:
      profile: your-org-account2
      region:
        - us-east-1
    excel:
      transpose: true
    sheets: *sheets

Then you need to run the auto-inventory script multiple times for your accounts as follows:

./dist/aws-auto-inventory --name your-org-master
./dist/aws-auto-inventory --name your-org-account1
./dist/aws-auto-inventory --name your-org-account1

Now, download the binary according to your operating system and platform and execute it, informing which inventory you want to generate. The tool will create a folder aws-auto-inventory-report, in the current path, with the inventory report inside.

Testing


Expand

AWS-Auto-Inventory uses boto3. You can use any service that contains any list or describe method to fetch information about your resources.

Parameters

You can use boto3 parameters to narrow down your search results.

Filter by tag:Name

sheets:
  - name: VPC
    service: ec2
    function: describe_vpcs
    result_key: Vpcs
    parameters:
      Filters:
        - Name: tag:Name
          Values:
            - my-vpc

Filter by vpc-id

sheets:
  - name: Subnets
    service: ec2
    function: describe_subnets
    result_key: Subnets
    parameters:
      Filters:
        - Name: vpc-id
          Values:
            - vpc-xxx

Find a particular RDS instance

sheets:
  - name: RDS
    service: rds
    function: describe_db_instances
    result_key: DBInstances
    parameters:
      DBInstanceIdentifier: the-name-of-my-rds-instance

Find EC2 instances by a particular tag

sheets:
  - name: EC2
    service: ec2
    function: describe_instances
    result_key: Reservations
    parameters:
      Filters:
        - Name: tag:ApplicationName
          Values:
            - my-application

Find a particular IAM Role

sheets:
  - name: IAM.Role
    service: iam
    function: get_role
    result_key: Role
    parameters:
      RoleName: my-role

Contributors


Expand
Name Email Role
Silva, Valter [email protected] AWS Professional Services - Cloud Architect

Security

See CONTRIBUTING for more information.

References


Expand

License


This project is licensed under the Apache License 2.0.

For more information please read LICENSE.

Copyright


Amazon, Inc. or its affiliates. All Rights Reserved.
Comments
  • running on Ubuntu 18.04, glibc requirement and version issue

    running on Ubuntu 18.04, glibc requirement and version issue

    Hi,

    Upon trying to run the linux binary on Ubuntu 18.04, aws-auto-inventory appears to have a requirement on glibc:

    $ aws-auto-inventory 
    [24646] Error loading Python lib '/tmp/_MEIXX3OpN/libpython3.9.so.1.0': dlopen: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by /tmp/_MEIXX3OpN/libpython3.9.so.1.0)
    

    While I did install glibc-source, the package version available in Ubuntu repositories is 2.27:

    Package: glibc-source
    Status: install ok installed
    Priority: optional
    Section: devel
    Installed-Size: 23845
    Maintainer: Ubuntu Developers <[email protected]>
    Architecture: all
    Multi-Arch: foreign
    Source: glibc
    Version: 2.27-3ubuntu1.4
    Replaces: eglibc-source
    Recommends: xz-utils
    Conflicts: eglibc-source
    Description: GNU C Library: sources
     This package contains the sources and patches which are needed to
     build glibc.
    Homepage: https://www.gnu.org/software/libc/libc.html
    Original-Maintainer: GNU Libc Maintainers <[email protected]>
    Original-Vcs-Browser: https://salsa.debian.org/glibc-team/glibc
    Original-Vcs-Git: https://salsa.debian.org/glibc-team/glibc.git
    

    Any chance of packaging required dependencies into the binary file itself, like aws-cli v2?

    opened by darkwizard242 3
  • feature/pre-commit

    feature/pre-commit

    Description of changes: Add pre-commit configuration and apply the recommended changes.

    By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

    opened by valter-silva-au 1
  • Feature/workflow hygiene

    Feature/workflow hygiene

    Description of changes:

    Create workflow to ensure code and doc hygiene.

    By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

    opened by valter-silva-au 0
  • Feature/aws code habits

    Feature/aws code habits

    Description of changes:

    Adopt AWS Code Habits.

    By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

    opened by valter-silva-au 0
  • Update devcontainer configuration

    Update devcontainer configuration

    *Description of changes:

    Update the vscode devcontainer configuration for better performance and stability.

    By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

    enhancement 
    opened by valter-silva-au 0
  • Release 0.2.0

    Release 0.2.0

    Description of changes: Release of new features and bug fixes.

    By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

    bug enhancement 
    opened by valter-silva-au 0
  • Feature/aws credentials

    Feature/aws credentials

    Description of changes: Allow user to provide AWS environment variables.

    By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

    opened by valter-silva-au 0
  • Bump numpy from 1.20.0 to 1.22.0

    Bump numpy from 1.20.0 to 1.22.0

    Bumps numpy from 1.20.0 to 1.22.0.

    Release notes

    Sourced from numpy's releases.

    v1.22.0

    NumPy 1.22.0 Release Notes

    NumPy 1.22.0 is a big release featuring the work of 153 contributors spread over 609 pull requests. There have been many improvements, highlights are:

    • Annotations of the main namespace are essentially complete. Upstream is a moving target, so there will likely be further improvements, but the major work is done. This is probably the most user visible enhancement in this release.
    • A preliminary version of the proposed Array-API is provided. This is a step in creating a standard collection of functions that can be used across application such as CuPy and JAX.
    • NumPy now has a DLPack backend. DLPack provides a common interchange format for array (tensor) data.
    • New methods for quantile, percentile, and related functions. The new methods provide a complete set of the methods commonly found in the literature.
    • A new configurable allocator for use by downstream projects.

    These are in addition to the ongoing work to provide SIMD support for commonly used functions, improvements to F2PY, and better documentation.

    The Python versions supported in this release are 3.8-3.10, Python 3.7 has been dropped. Note that 32 bit wheels are only provided for Python 3.8 and 3.9 on Windows, all other wheels are 64 bits on account of Ubuntu, Fedora, and other Linux distributions dropping 32 bit support. All 64 bit wheels are also linked with 64 bit integer OpenBLAS, which should fix the occasional problems encountered by folks using truly huge arrays.

    Expired deprecations

    Deprecated numeric style dtype strings have been removed

    Using the strings "Bytes0", "Datetime64", "Str0", "Uint32", and "Uint64" as a dtype will now raise a TypeError.

    (gh-19539)

    Expired deprecations for loads, ndfromtxt, and mafromtxt in npyio

    numpy.loads was deprecated in v1.15, with the recommendation that users use pickle.loads instead. ndfromtxt and mafromtxt were both deprecated in v1.17 - users should use numpy.genfromtxt instead with the appropriate value for the usemask parameter.

    (gh-19615)

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Feature/build on GitHub

    Feature/build on GitHub

    Description of changes: Allow builds to be executed on Github.

    By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

    opened by valter-silva-au 0
  • Feature/print file path

    Feature/print file path

    Description of changes:

    Print the file path of the report generated.

    By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

    opened by valter-silva-au 0
  • Upgrade urllib3

    Upgrade urllib3

    *Issue #, if available: https://github.com/aws-samples/aws-auto-inventory/security/dependabot/requirements.txt/urllib3/open

    Description of changes: Upgrade urllib3

    By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

    opened by valter-silva-au 0
  • Allow Outputs of Other Sheets/Comands

    Allow Outputs of Other Sheets/Comands

    I would like to better document my inventory, not all boto3 client actions return details of my resources. I would like it to be possible to use outputs from other spreadsheets to generate spreadsheets with more details of AWS resources.

    Possible config.yaml

    ---
    Sheets: &sheets
      - name: EKSClusterNames
        service: eks
        function: list_clusters
    
      - name: EKSClusterDetails
        service: eks
        function: describe_cluster
        output_parameter: EKSClusterNames # loop the client action based in EKS Cluster Name list
    
    inventories:
      - name: aws-test
        aws:
          profile: aws-test
          region:
            - us-east-1
            - sa-east-1
        excel:
          transpose: false
        sheets: *sheets
    
    opened by evairmarinho 1
  • Document `config.yaml` arguments

    Document `config.yaml` arguments

    Congrats on the tool! It seems to be very powerful, however some parameters I need are not documented. Would it be possible to document all possible arguments within the configuration YAML?

    opened by evairmarinho 0
Releases(0.2.0)
  • 0.2.0(Aug 16, 2022)

    Changelog

    Improvements

    • Use of Dev Containers for development

    Features

    • Allow users to use AWS environment variables, making the use of AWS profile optional.

    Bug Fixes

    • General improvements.

    What's Changed

    • Bump numpy from 1.20.0 to 1.22.0 by @dependabot in https://github.com/aws-samples/aws-auto-inventory/pull/9
    • Feature/aws credentials by @valter-silva-au in https://github.com/aws-samples/aws-auto-inventory/pull/12
    • Release 0.2.0 by @valter-silva-au in https://github.com/aws-samples/aws-auto-inventory/pull/13

    New Contributors

    • @dependabot made their first contribution in https://github.com/aws-samples/aws-auto-inventory/pull/9

    Full Changelog: https://github.com/aws-samples/aws-auto-inventory/compare/0.1.3...0.2.0

    Source code(tar.gz)
    Source code(zip)
    aws-auto-inventory-macos(41.74 MB)
    aws-auto-inventory-ubuntu(51.39 MB)
    aws-auto-inventory-windows.exe(37.56 MB)
  • 0.1.2(Jun 5, 2021)

  • 0.1.0(Jun 4, 2021)

    You will need to create a config.yaml file in order to tell the tool how to generate your inventory, here are the default search paths for each platform:

    • OS X: ~/.config/aws-auto-inventory/config.yaml or ~/Library/Application Support/aws-auto-inventory/config.yaml
    • Other Unix: $XDG_CONFIG_HOME/aws-auto-inventory/config.yaml or ~/.config/aws-auto-inventory/config.yaml
    • Windows: %APPDATA%\aws-auto-inventory\config.yaml where the APPDATA environment variable falls back to %HOME%\AppData\Roaming\config.yaml if undefined

    You can use the config-sample as an example. A snippet can be found below:

    inventories:
      - name: your-inventory-name
        aws:
          profile: your-aws-profile
          region:
            - us-east-1
        excel:
          transpose: true
        sheets:
          - name: EC2 # sheet name on Excel
            service: ec2 # the boto3 client of an AWS service
            function: describe_instances # the client method of the service defined above
            result_key: Reservations # [optional]: The first key of the response dict
          - name: EBS
            service: ec2
            function: describe_volumes
            result_key: Volumes
    

    Now, download the binary according to your operating system and platform and execute it, informing which inventory you want to generate. The tool will create a folder aws-auto-inventory-report, in the current path, with the inventory report inside.

    Testing


    AWS-Auto-Inventory uses boto3. You can use any service that contains any list or describe method to fetch information about your resources.

    Parameters

    You can use boto3 parameters to narrow down your search results.

    Filter by tag:Name

    sheets:
      - name: VPC
        service: ec2
        function: describe_vpcs
        result_key: Vpcs
        parameters:
          Filters:
            - Name: tag:Name
              Values:
                - my-vpc
    

    Filter by vpc-id

    sheets:
      - name: Subnets
        service: ec2
        function: describe_subnets
        result_key: Subnets
        parameters:
          Filters:
            - Name: vpc-id
              Values:
                - vpc-xxx
    

    Find a particular RDS instance

    sheets:
      - name: RDS
        service: rds
        function: describe_db_instances
        result_key: DBInstances
        parameters:
          DBInstanceIdentifier: the-name-of-my-rds-instance
    

    Find EC2 instances by a particular tag

    sheets:
      - name: EC2
        service: ec2
        function: describe_instances
        result_key: Reservations
        parameters:
          Filters:
            - Name: tag:ApplicationName
              Values:
                - my-application
    

    Find a particular IAM Role

    sheets:
      - name: IAM.Role
        service: iam
        function: get_role
        result_key: Role
        parameters:
          RoleName: my-role
    
    Source code(tar.gz)
    Source code(zip)
    aws-auto-inventory-darwin-x86_64(38.03 MB)
    aws-auto-inventory-linux-x86_64(46.09 MB)
    aws-auto-inventory-windows-amd64.exe(35.35 MB)
Owner
AWS Samples
AWS Samples
SC4.0 - BEST EXPERIENCE · HEX EDITOR · Discord Nuker · Plugin Adder · Cheat Engine

smilecreator4 This site is for people who want to hack or want to learn it! Furthermore, this program does not work without turning off Antivirus or W

1 Jan 04, 2022
AWS CloudSaga - Simulate security events in AWS

AWS CloudSaga - Simulate security events in AWS AWS CloudSaga is for customers to test security controls and alerts within their Amazon Web Services (

Amazon Web Services - Labs 325 Dec 01, 2022
Source code of BobuxAdmin bot from Bobux Bot Development server.

BobuxAdmin Source code of BobuxAdmin bot from Bobux Bot Development server. The bot is written with usage of disnake and SQLite database. Functionalit

Bobux Bot Developers 3 Dec 29, 2022
Telegram bot made with Python to get notified when visa slots are available

Visa slot bot I created this bot to getnotified when screenshots are available in the Telegram channel for dropbox appointments. How do I use this? Ch

Jimil 7 Jan 03, 2023
This script books automatically a slot on Doctolib in one of the public vaccination centers in Berlin.

BOOKING IN BERLINS VACCINATION CENTERS This python script books automatically a slot on Doctolib in one of the public vaccination centers in Berlin. T

17 Jan 13, 2022
Bot for mirroring one or multiple Twitter accounts in Pleroma/Mastodon.

Stork (pleroma-bot) Mirror one or multiple Twitter accounts in Pleroma/Mastodon. Introduction After using the pretty cool mastodon-bot for a while, I

73 Jan 08, 2023
🦊 Powerfull Discord Nitro Generator

🦊 Follow me here 🦊 Discord | YouTube | Github ☕ Usage 💻 Downloading git clone https://github.com/KanekiWeb/Nitro-Generator/new/main pip insta

Kaneki 104 Jan 02, 2023
Pdisk Link Converter Telegram Bot, Convert link in a single click

Pdisk Converter Bot Make short link by using Pdisk API key Installation The Easy Way Required Variables BOT_TOKEN: Create a bot using @BotFather, and

Ayush Kumar Jaiswal 6 Jul 28, 2022
Weather App using openweathermap API

This is my hobby project used to learn how to use public api for project.In this i used the api of openweathermap to featch the weather details of various city across the globe by giving city name as

Subramanya K S 1 Nov 06, 2021
Group Chat Spammer For Discord

Group Chat Spammer For Discord Free and public gc spammer

Dreamy 20 Dec 27, 2022
A Telegram Bot for adding Footer caption beside main caption of Telegram Channel Messages.

Footer-Bot A Telegram Bot for adding Footer caption beside main caption of Telegram Channel Messages. Best for Telegram Movie Channels. Made by @AbirH

Abir Hasan 35 Jan 02, 2023
A simple tool that allows you to change your default AWS CLI profile.

Select AWS Profile Select AWS Profile (slapr) is a simple tool that lets you select which AWS Profile you want to use and sets it as the default AWS p

Antoni Yanev 2 Nov 09, 2022
𝐀 𝐦𝐨𝐝𝐮𝐥𝐚𝐫 𝐓𝐞𝐥𝐞𝐠𝐫𝐚𝐦 𝐆𝐫𝐨𝐮𝐩 𝐦𝐚𝐧𝐚𝐠𝐞𝐦𝐞𝐧𝐭 𝐛𝐨𝐭 𝐰𝐢𝐭𝐡 𝐮𝐥𝐭𝐢𝐦𝐚𝐭𝐞 𝐟𝐞𝐚𝐭𝐮𝐫𝐞𝐬 !!

𝐇𝐨𝐰 𝐓𝐨 𝐃𝐞𝐩𝐥𝐨𝐲 For easiest way to deploy this Bot click on the below button 𝐌𝐚𝐝𝐞 𝐁𝐲 𝐒𝐮𝐩𝐩𝐨𝐫𝐭 𝐆𝐫𝐨𝐮𝐩 𝐒𝐨𝐮𝐫𝐜𝐞𝐬 𝐆𝐞𝐧𝐞?

Mukesh Solanki 1 Dec 10, 2021
An Telegram Bot By @ZauteKm To Stream Videos In Telegram Voice Chat Of Both Groups & Channels. Supports Live Streams, YouTube Videos & Telegram Media !!

Telegram Video Stream Bot (Py-TgCalls) An Telegram Bot By @ZauteKm To Stream Videos In Telegram Voice Chat Of Both Groups & Channels. Supports Live St

Zaute Km 14 Oct 21, 2022
A Telegram Bot Plays With Words!!!

TheWordzBot ➠ I Can Turn Text Into Audio ➠ I Can Get Results From Dictionary ➠ I Can Make Google Search For You ➠ I Can Suggest Strong Passwords For Y

RAVEEN KUMAR 8 Feb 28, 2022
A Code that can make your Discord Account 24/7!

Online-Forever Make your Discord Account Online 24/7! A Code written in Python that helps you to keep your account 24/7. The main.py is the main file.

Phantom 556 Dec 29, 2022
A unified API wrapper for YouTube and Twitch chat bots.

Chatto A unified API wrapper for YouTube and Twitch chat bots. Contributing Chatto is open to contributions. To find out where to get started, have a

Ethan Henderson 5 Aug 01, 2022
Telegram Link Shortener Bot (With 20 Shorteners)

Telegram ShortenerBot ShortenerBot: 🇬🇧 Telegram Link Shortener Bot (11 + 9 Shorteners) 🇹🇷 Telegram Link Kısaltıcı Bot (11 + 9 Kısaltıcı) All suppo

Hüzünlü Artemis [HuzunluArtemis] 10 May 24, 2022
thumbor is an open-source photo thumbnail service by globo.com

Survey If you use thumbor, please take 1 minute and answer this survey? It's only 2 questions and one is multiple choice!!! thumbor is a smart imaging

Thumbor (by @globocom) 9.3k Dec 31, 2022
Telegram File to Link Fastest Bot , also used for movies streaming

Telegram File Stream Bot ! A Telegram bot to stream files to web. Report a Bug | Request Feature About This Bot This bot will give you stream links fo

Avishkar Patil 194 Jan 07, 2023