janiko71 / aws-inventory

Python script for AWS resources inventory (cheaper than AWS Config)
GNU General Public License v3.0
164 stars 64 forks source link

empty namespaces still return values #55

Closed DawidKrysiak closed 2 weeks ago

DawidKrysiak commented 2 years ago

Not a big issue, but I wonder if anyone has a quick solution for it. I am using this script to generate an inventory for documentation purposes (I save nicely formatted yaml files rather than jsons). I wish to achieve two things

  1. avoid adding empty sections as per below - is there a way to omit those?
    ec2: []
    ec2-ebs: []
    ec2-egpu: []
    ec2-eips: []
  2. only return specific fields from an inventory. e.g: for EvenBus, I only need 'Name', not a whole blob of 17 lines.

Kind regards Dawid

janiko71 commented 1 year ago

Hi, sorry, I'm a bit busy these days. Omitting empty sections could be a good idea, but sometimes this empty result is what you are looking for. So we can add a parameter for this usage, but I don't if the best location for this it's in the script. For selecting fields, it's really more difficult because the field names are not really standardized: you'll have to know exactly what you want for every service you will call. If you want this feature, you'll need to have a very long parameters list. Here I'm sure that this filtering should be made outside the script, but it could be a good idea to add Python scripts to format the raw output.

janiko71 commented 2 weeks ago

No more relevant with the new version.