Improved exception handling while obtaining the AWS region and server instance ID