Table: aws_organizations_root - Query AWS Organizations Root using SQL
AWS Organizations uses a hierarchical structure to manage accounts. At the top of this hierarchy is the "root." The root is the starting point for organizing your AWS accounts. The root acts as the parent container for all the accounts in your organization. It can also contain organizational units (OUs), which are sub-containers that can themselves contain accounts or further nested OUs.
Table Usage Guide
The aws_organizations_root
table in Steampipe provides you the information about AWS Organizations Root Account.
Examples
Basic info
It's particularly useful in contexts where managing or auditing AWS Organizations.
select name, id, arnfrom aws_organizations_root;
select name, id, arnfrom aws_organizations_root;
Get the policy details attached to organization root account
The types of policies that are currently enabled for the root and therefore can be attached to the root or to its OUs or accounts.
select id, name, p ->> 'Status' as policy_status, p ->> 'Type' as policy_typefrom aws_organizations_root, jsonb_array_elements(policy_types) as p;
select id, name, json_extract(json_each.value, '$.Status') AS policy_status, json_extract(json_each.value, '$.Type') AS policy_typefrom aws_organizations_root, json_each(policy_types) as p;
Schema for aws_organizations_root
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
account_id | text | =, !=, ~~, ~~*, !~~, !~~* | The AWS Account ID in which the resource is located. |
akas | jsonb | Array of globally unique identifier strings (also known as) for the resource. | |
arn | text | The Amazon Resource Name (ARN) of the root. | |
id | text | The unique identifier (ID) for the root. | |
name | text | The friendly name of the root. | |
partition | text | The AWS partition in which the resource is located (aws, aws-cn, or aws-us-gov). | |
policy_types | jsonb | The types of policies that are currently enabled for the root and therefore can be attached to the root or to its OUs or accounts. | |
region | text | The AWS Region in which the resource is located. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
title | text | Title of the resource. |
Export
This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- aws
You can pass the configuration to the command with the --config
argument:
steampipe_export_aws --config '<your_config>' aws_organizations_root