Giter VIP home page Giter VIP logo

aws-auto-inventory's Introduction

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

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.

aws-auto-inventory's People

Contributors

valter-silva-au avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.