aws-samples / aws-auto-inventory

AWS Auto Inventory allows you to quickly and easily generate inventory reports of your AWS resources.
Apache License 2.0
194 stars 31 forks source link

Result key should support jq based fields #51

Closed sandipnahak closed 8 months ago

sandipnahak commented 1 year ago

Currently, the scan JSON file contains the result_key which is based on a single key that calls the AWS service function and returns "ResponseMetadata", supporting JQ-based fields in the result_key option to get more granular and shortened results.

Continue to support key based filtering from response

  {
    "function": "list_clusters",
    "service": "emr",
    "parameters": {
      "ClusterStates": [
            "WAITING"
          ]
        },
    "result_key": "Clusters"
}
]

Also, support JQ based filter query

  {
    "function": "list_clusters",
    "service": "emr",
    "parameters": {
      "ClusterStates": [
            "WAITING"
          ]
        },
    "result_key": ".Clusters[]|.Id, .Name"
}
]
sandipnahak commented 8 months ago

https://github.com/aws-samples/aws-auto-inventory/pull/60