How to get the canonical id of your AWS account

From AWS Command Line Interface, run the below command to get the canonical id of your AWS account.

aws s3api list-buckets --query Owner.ID

See also  POSITION function in Redshift database