AWS Elastic Beanstalk Deployment Order
<p>I'm deploying code to a single-instance web server AWS EB environment that will provision/update my connected RDS database.  I've got an .ebextensions file that calls deployment code:</p>

<pre><code>---
container_commands:
  01deploydb:
    command: /var/www/html/php/cli/deploy-db.php
    leader_only: true
</code></pre>

<p>On the same deployment, I dropped the deploy-db.php file back one directory into <code>/cli/</code>.  On deployment, I get <code>ERROR: [Instance: i-*****] Command failed on instance. Return code: 127 Output: /bin/sh: /var/www/html/php/cli/deploy-db.php: No such file or directory. 
container_command 01deploydb in .ebextensions/01_db.config failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.</code></p>

<p>If I deploy a version that does not include the command, then deploy a second update including the command, there is no error.  However, adding the command and the file it calls at the same time produces the error.  A similar sequence occurred earlier with a different command/file.</p>

<p><strong>My question is: is there a documented order/sequence for how AWS updates the environment?</strong>  I would have expected that my new version would have fully deployed (and the .php file installed) before container_commands are called.</p>