-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add table aws_organizations_organizational_unit and aws_organizations_root. closes #1674 #1677
Conversation
@ParthaI could you please add a few more example queries in the table docs? Maybe you need to join it with other tables to reflect its usage. |
Hi @ParthaI, thank you for the swift addition. Unfortunately I do not have the rights to execute that particular API call to test this case :-( |
Hi again @ParthaI, I'll elaborate on my limits as maybe this will impact #1675 I can call ListChildren that can yield either OUs or AWS accounts. As I suggested the addition of that table so Steampipe can then link accounts back to OUs (which is, iirc, an information you can only have from the AWS organization account), maybe you would have an interest to use ListChildren rather than ListAccountsForParent? I'm thinking out loud here and obviously biased toward using ListChildren rather than ListAccountsForParent, so feel free to not go this way. |
|
||
A container for accounts within a root. An OU also can contain other OUs, enabling you to create a hierarchy that resembles an upside-down tree, with a root at the top and branches of OUs that reach down, ending in accounts that are the leaves of the tree. When you attach a policy to one of the nodes in the hierarchy, it flows down and affects all the branches (OUs) and leaves (accounts) beneath it. An OU can have exactly one parent, and currently each account can be a member of exactly one OU. | ||
|
||
**Note**: The `parent_id` is the required to make the API call. It is the unique identifier (ID) of the root or OU whose child OUs you want to list. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your second example in this ticket does not specify parent_id
, how come it worked?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your second example in this ticket does not specify
parent_id
, how come it worked?
In the table definition we have two config one is List Config and another one is Get Config.
In List config we generally make list API call and in Get config we make the get API call.
Here we are using ListAccountsForParent API in the List config
, for making the ListAccountsForParent
API call we must need to pass the ParentId
in param of this API call, so parent_id
is required to make list API call.
In Get config we are using the DescribeOrganizationalUnit API call, for making this API call we must have to pass the OrganizationalUnitId
, we do not need ParentId
for this API call.
The Get API will be called if we are providing id
as query parameter, so in second example we need to pass the parent_id
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it for the logic underneath ; may I suggest a working like this?
**Note**: The `parent_id` is the required to make the API call. It is the unique identifier (ID) of the root or OU whose child OUs you want to list. | |
You **_must_** specify a single `parent_id` or `id` in a where or join clause in order to use this table. |
I found similar wording/format for aws_route53_record, aws_iam_access_advisor, aws_cloudtrail_trail_event and others
Also from a user perspective I find it odd that we can't have the listing without a parent_id, but looking at API reference it looks tricky to get the root id reliably...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah @ajoga, this looks better, will push the changes. Thanks!
@ajoga Thanks for the suggestion will play around those APIs and will let you know. Thanks again. |
This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days. |
This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days. |
This PR was closed because it has been stalled for 90 days with no activity. |
This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days. |
This PR was closed because it has been stalled for 90 days with no activity. |
…l parent_id. And now this table can be join with the table aws_organizations_organizational_unit
…nt hydrate combinations
…rganizational unit for a given account
|
||
### Select organizational units with a path that matches a specific pattern | ||
|
||
```sql |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add queries for both postgres
and sqlite
Co-authored-by: Madhushree Ray <[email protected]>
Co-authored-by: Madhushree Ray <[email protected]>
Co-authored-by: Madhushree Ray <[email protected]>
Integration test logs
Logs
Example query results
Results