Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

283
Views
Is there any php function that wait untill aws lightsail instance state is running?

I have used this code to create aws lightsail instance using php code.

$client->createInstances([
        'addOns' => [
            [
                'addOnType' => 'AutoSnapshot',
                'autoSnapshotAddOnRequest' => [
                    'snapshotTimeOfDay' => config('aws.snapshotTime'),
                ],
            ],
        ],
        'availabilityZone' => config('aws.instanceAvailabilityZone'),
        'blueprintId' => config('aws.os'),
        'bundleId' => config('aws.instanceType'),
        'instanceNames' => ['testinstance],
        'userData' => config('aws.afterInstallScript'),
    ]);
   return $result = $client->getInstanceState([
        'instanceName' => $instanceName
    ]);

The code is executed with instance state pending. But my requirement is that it should return when the instance state is running. Aws SDK has waitUntil() function but I don't know how to use this in lightsail.

Can anyone help me with this?

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!