public function getDefaultUsername()
{
if (is_null($this->username)) {
if ($user = $this->getInspectorConfiguration('user')) {
$this->username = $user;
} elseif ($user = $this->getTag('inspector:user')) {
// deprecated!
$this->username = $user;
} elseif ($user = getenv('AWSINSPECTOR_DEFAULT_EC2_USER')) {
$this->username = $user;
} else {
$this->username = 'ec2-user';
$ami = $this->getImageId();
if (in_array($ami, ['ami-47a23a30', 'ami-47360a30', 'ami-d05e75b8'])) {
$this->username = 'ubuntu';
}
}
}
return $this->username;
}