AWS Organizations and AWS Profiles
AWS Organizations is a service designed to help you centrally manage and govern multiple AWS accounts within your organization. It allows you to group accounts into organizational units (OUs), apply policies for better security, control costs, and ensure compliance. With AWS Organizations, you can automate account creation, set resource policies, and consolidate billing across accounts.
The AWS for Query.Farm integration interacts with AWS Organizations by creating AWS Profiles that automatically obtain access to an organizations account so you can query them without having to manually maintain a list of AWS accounts.
Integrating AWS Organizations into AWS Profiles
Each AWS Profile includes two optional settings:
- Scan organization accounts: This option creates AWS Profiles for each account within the organization.
- Retrieve organization details: This retrieves information about the account, such as its name (if set), the master account, and the account’s hierarchy within the organization.
Additionally, you can control the role name used when assuming roles in organization accounts and specify which accounts to exclude from the account list.
These properties can be created and modified when you create the AWS Profile.
Filtering Data by AWS Organization
You can filter AWS resources based on their membership in an AWS Organization by including conditions in the WHERE clause of your query. Each row returned from AWS includes a _aws_profile column and inside of that column’s value is all of the AWS Organization information from the AWS Profile.
For example, to filter EC2 instances that belong to an account named Development:
SELECT * FROM aws.ec2.describe_instancesWHERE _aws_profile.organization.account_name = 'Development';You can filter not only by account name, but also by account ID, tags, master account, or account hierarchy.
Schema of _aws_profile
This is the schema of the _aws_profile column.
| _aws_profile Input Column The AWS profile defines the AWS identity used. It can be defined via credentials or by assuming a IAM role. | STRUCT( |
Show child fields
| |