Using aws php sdk's waitUntilDBInstanceAvailable()

139 views Asked by At

I'm trying to use the waitUntilDBInstanceAvailable() to wait for my newly created instance to be available so that I can grab the endpoint name.

Note: The endpoint name is not available until the instance is fully up.

I've looked at waiters but it uses different methods params, waitUntilDBInstanceAvailable takes 1 array as an argument per documentation.

    $results = $rds->waitUntilDBInstanceAvailable([
        'DBInstanceIdentifier' => 'my-rds-instance'
    ]);

    $instanceEndPoint = $results->DBInstances->EndPoint // Theoretically
2

There are 2 answers

0
Adam Ocsvari On

I'm not sure what is your exact question, but check this question/answer:

Is it possible to register a callback function to waitUntilDBInstanceAvailable()?

0
Jeremy Lindblom On

Waiters share the input parameters of the operation they use. In this case, the docs say "The input array uses the parameters of the DescribeDBInstances operation", which means you can use the parameters of the DescribeDBInstances operation.

However, waiters do not return results as you have assumed in your code example. Looking at the docs, there is no return value documented. Therefore, the usage of waiters is consistent with the documentation. If you need to get data about the thing you are waiting for, then you need to follow up with a separate call after the waiting is complete.