title: How to get AWS account details using java api? Not for IAM user
body: <p>We have two AWS accounts. One is for production and another is for testing. We need to differentiate the environment we are running. We can see that a simple way is to get account name and once we get that it will be very straight forward. But, we don't know how to get it from AWS credentials or properties. Does anyone have idea about how to get account information using AWS credentials? 
  I considered the possibility of account permissions, account type etc, but I think it should not prevent us from getting account name?  </p>