feat(aws-resources): Add IAM Access Advisor#8726
feat(aws-resources): Add IAM Access Advisor#8726kodiakhq[bot] merged 4 commits intocloudquery:mainfrom
Conversation
This PR has the following changes to source plugin(s) tables:
|
371249a to
639937e
Compare
|
How much concurrency does AWS support? |
plugins/source/aws/resources/services/iam/last_accessed_jobs.go
Outdated
Show resolved
Hide resolved
plugins/source/aws/resources/services/iam/last_accessed_jobs.go
Outdated
Show resolved
Hide resolved
plugins/source/aws/resources/services/iam/last_accessed_jobs.go
Outdated
Show resolved
Hide resolved
plugins/source/aws/resources/services/iam/last_accessed_jobs.go
Outdated
Show resolved
Hide resolved
639937e to
8185ce0
Compare
@bbernays can you explain your comment? Do you mean API limits? Concurrent report jobs limit? I couldn't find anything about this in the AWS docs |
Yeah I mean about concurrent reports jobs limit. I know the original PR had all of the jobs being created sequentially, so I wonder if there was a technical reason for that |
I did not hit any limits on our playground account 😄 nor could find any docs about it |
|
I'd like to check my understanding of this code:
Is my understanding correct? This is a clever solution! I think it subtly changes the semantics of our tables though - especially the |
8185ce0 to
d3ed6b9
Compare
|
@hermanschaaf cleaned up the job tables in d3ed6b9 |

Summary
Fixes #1402
Fixes #1389
Fixes #1388
Fixes #1387
Fixes #1386
This PR implements https://docs.aws.amazon.com/cli/latest/reference/iam/get-service-last-accessed-details.html, but not https://docs.aws.amazon.com/cli/latest/reference/iam/get-service-last-accessed-details-with-entities.html as getting the entities is what makes this super slow.
I put the table definitions and fetchers in the same file as I think it's easier to follow the code that way, but happy to split into multiple files (one per table).
This follows a pattern of using relations to get maximum concurrency based on the spec setting.
Explanation about PKs:
We use an Arn to get a job, so 1-1 mapping. Hence we can use the Arn as the PK for the jobs tableServicesLastAccessed. If you look at https://docs.aws.amazon.com/cli/latest/reference/iam/get-service-last-accessed-details-with-entities.html you'll see you need to pass a job ID and a service namespace to get the entities. Hence we should be able to use Arn (1-1 mapping to a job ID) and service namespace for uniqueness of eachServicesLastAccessed.Syncing these tables takes
2m21son our playground accountBEGIN_COMMIT_OVERRIDE
feat(aws-resources): Add IAM Access Advisor tables:
aws_iam_group_last_accessed_details,aws_iam_policy_last_accessed_details,aws_iam_role_last_accessed_detailsandaws_iam_user_last_accessed_details. These might be slow to sync on some accounts. You can skip them if needed viaskip_tables: ["aws_iam_*_last_accessed_details"]END_COMMIT_OVERRIDE