public function getAccountNumber()
{
if ($this->awsAccountNumber === null) {
try {
$arr = preg_split('/\\:/', $this->iam->user->fetch()->arn);
$this->awsAccountNumber = $arr[4];
} catch (ClientException $e) {
if (preg_match('/arn\\:aws[\\w-]*\\:iam\\:\\:(\\d+)\\:user/', $e->getMessage(), $matches)) {
$this->awsAccountNumber = $matches[1];
} else {
throw $e;
}
}
}
return $this->awsAccountNumber;
}