There has not been a way to discover the AWS Account ID for some time from within the command line in Linux, but now there is and it took me some digging to find it. You will find everything for your specific instance from the AWS Account ID, to the region, availability zone, AMI, etc. The code is shown below.