Querying AWS at scale across APIs, regions, and accounts
aws.amazon.com
aws.amazon.com
To explain... Steampipe has this amazing autocomplete functionality so you don't even have to know the table name you want - you can just start typing the table name and it will show you the list of possible matches. But because you have to type the "column names" before you type the "table name", Steampipe is unable to offer any autocomplete on the available attributes.
For example, instead of typing: `SELECT name, create_date FROM aws_iam_role` it would be much better if you could type: `FROM aws_iam_role SELECT name, create_date`. That way, Steampipe would be able to autocomplete the attributes available for each object.
Because rate limits are separate across accounts, regions and services, the parallel queries work really well in those cases.
We do sub-API queries for tables, but only when the column is requested. So, "select name from aws_s3_bucket" just does a list call while "select * from aws_s3_bucket" does multiple API calls per row. These sub-API calls are the main potential source of rate limits since they hit the same API [1]. BTW, Cloud Control from AWS is actually much more subsceptible to this problem! [2].
We also use a custom backoff algorithm that is fast then slow to give good speed in the usual cases and ensure results if throttling ramps up [3].
Finally, we automatically cache results in memory between requests and can always save results into materialized views or similar to avoid repeated calls in larger cases.
TBH, live querying of APIs has proven so much more effective than we even hoped when we started!
1 - https://steampipe.io/blog/selective-select 2 - https://steampipe.io/blog/aws-cloud-control 3 - https://github.com/turbot/steampipe-plugin-aws/blob/4cbd8813...
But I was doing it every 5 minutes and storing the result in postgres instead of it being on demand. I very quickly received a call from our account rep asking for it to not query particular services as frequently.
Apparently some of the newer services at the time I was scraping were not as optimized in terms of response caching or metadata queries as they should have been.
(Note: apparently it wasn't the overall frequency that was the problem, it was a few services that returned paginated results and fetching every page every 5 minutes was causing issues.)
Azure uses a unified resource manager that has everything in "one place".
AWS uses a "federation of systems" with almost nothing in common, except for authentication.
Azure's approach is more consistent and makes things like resource graph relatively easy to implement.
AWS's approach is more robust against failure, because the various service offerings are more independent and have fewer common failure points.
This isn't just theory, it matches my experience pretty well. I hate how in AWS I have to switch portals to go from service-to-service, whereas in Azure the "Resource Groups" contain all related resources in one place, even if it's a random mix of IaaS and PaaS. Conversely, I've been bitten by several wide-spread Azure outages. Repeatedly.
It all depends on your business requirements. For me, the consistency is more important. For other people, availability is far more critical.
1 - https://aws.amazon.com/cloudcontrolapi/ 2 - https://steampipe.io/blog/aws-cloud-control