I am trying to output a table using CLI that has two columns, with column A showing the data set ID and column B including all principals associated with that data set. I need this to know who to notify when working on cleaning up un-used datasets to clear up SPICE capacity.
Using the following CLI script, however, results in two different table views, depending on the number of principals per data set. When there’s only one principal for a data set, the table format is acceptable. However when there are multiple principals, the table is not correct.
aws quicksight describe-data-set-permissions --aws-account-id 000000000000 --data-set-id 00000000-0000-0000-0000-000000000000 --query '{DataSetId:DataSetId,Principal:to_string(Permissions|[].Principal)}' --output table
Result with one principal per dataset:
Result with multiple principals per dataset:
Is there a way to output a table with the desired two columns when a dataset has multiple principals?