Extends aws_account to include account_profile column which is pulled get GetConfig from the spc file. This can be useful if someone wants to join on account and display account_profile vs account_aliases if they don't have aliases defined in AWS.
Example query results
Results
> select account_id,account_profile from aws_all.aws_account
+---------------+-------------------+
| account_id | account_profile |
+---------------+-------------------+
| 000000000000 | shared-services |
| 000000000001 | nonprod |
| 000000000002 | prod |
+---------------+-------------------+
Updated the code so that during awsConfig setup, if awsConfig.Profile is nil , sets an empty string as the pointer source
> select account_profile,account_id from aws_key.aws_account
+-----------------+--------------+
| account_profile | account_id |
+-----------------+--------------+
| default | XXXXXXXXXXXX |
+-----------------+--------------+
Using:
connection "aws_key" {
plugin = "aws"
access_key = "XXXXXXXXXXXXXXXXXXXX"
secret_key = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
regions = ["eu-west-1"]
}
Additional mixed-mode testing by mixing SSO and Key modes in an aggregator: (SSO profile name and account_ids replaced for account safety.
> select account_profile,account_id from aws_test_account_key.aws_account
+------------------------+--------------+
| account_profile | account_id |
+------------------------+--------------+
| David Personal Profile | XXXXXXXXXXXX |
+------------------------+--------------+
> select account_profile,account_id from aws_test_db_prod.aws_account
+-----------------------+--------------+
| account_profile | account_id |
+-----------------------+--------------+
| David SSO Profile | YYYYYYYYYYYY |
+-----------------------+--------------+
> select account_profile,account_id from aws_test_all.aws_account
+------------------------+--------------+
| account_profile | account_id |
+------------------------+--------------+
| David Personal Profile | XXXXXXXXXXXX |
| David SSO Profile | YYYYYYYYYYYY |
+------------------------+--------------+
>