public getUserArn ( ) : string | ||
return | string | Returns AWS user arn |
public function getUserArn()
{
try {
return $this->iam->user->fetch()->arn;
} catch (ClientException $e) {
if (preg_match('/arn\\:aws[\\w-]*\\:iam\\:\\:(\\d+)\\:user/', $e->getMessage(), $matches)) {
return $matches[0];
} else {
throw $e;
}
}
}