key(); } public function maxDuration(): int { return 300; } protected function host(ProvisioningRun $run): Host { /** @var Host $host */ $host = $run->subject; return $host; } protected function keyLogin(RemoteShell $shell, Host $host): void { $shell->connectWithKey($host->public_ip, 'root', (string) config('provisioning.ssh.private_key')); } protected function recordResource(ProvisioningRun $run, Host $host, string $kind, string $externalId): void { RunResource::firstOrCreate( ['run_id' => $run->id, 'kind' => $kind], ['host_id' => $host->id, 'external_id' => $externalId], ); } protected function hasResource(ProvisioningRun $run, string $kind): bool { return RunResource::query()->where('run_id', $run->id)->where('kind', $kind)->exists(); } }