title: AWS - Elastic Beanstalk installation commands
body: <p>I am deploying my API on elastic beanstalk. Everytime an instance is launched,  I need a specific folder "temp_storage" to have write access as this is where I store my images while resizing them before uploading to S3 bucket. I also need to install a few composer programs.</p>
  
  <p>My setup is </p>
  
  <pre><code>fd-api/
       composer.json (These need to be installed)
       temp_storage/ (This folder needs write access)
       .ebextensions/
            temp-folders.config
  </code></pre>
  
  <p><strong>temp-folders.config</strong></p>
  
  <pre><code>container_commands:
    chown_folder:
      command: "chown -R webapp /var/www/html/fd-api/temp_storage"
    chmod_folder:
      command: "chmod 777 /var/www/html/fd-api/temp_storage"
  </code></pre>
  
  <p>This is my understanding of how it should work but when I attempt to run this I get the errors: </p>
  
  <blockquote>
    <p>Unsuccessful command execution on instance id(s) 'i-03f5ed1eb55f52d17'. Aborting the operation.</p>
    
    <p>Failed to deploy application.</p>
    
    <p>During an aborted deployment, some instances may have deployed the new application version. To ensure all instances are running the same version, re-deploy the appropriate application version.</p>
  </blockquote>
  
  <p>I don't know where to begin debugging this? My understanding from reading is that composer files will automatically run every time an elastic beanstalk instance is generated and any commands in the .ebextension/something.config files will be run. </p>
  
  <p>Not really sure what user webapp is? assuming it's the default user for an elastic beanstalk instance?</p>
  
  <p>Any help would be awesome. </p>