title: How do you add chmod +x permission to an AWS Elastic Beanstalk platform hook?
body: <p><strong>Context</strong></p>
  <p>I am using Elastic Beanstalk to deploy a very simple test application. I have several packages I want to install using apt. I have included a <code>01_installations.sh</code> script with the installations in the <code>.platform/hooks/prebuild</code> directory. When I zip my application and deploy to Elastic Beanstalk, the logs confirm that the prebuild script runs, but it does not have permissions.</p>
  <pre><code>2020/08/12 21:03:46.674234 [INFO] Executing instruction: RunAppDeployPreBuildHooks
  2020/08/12 21:03:46.674256 [INFO] Executing platform hooks in .platform/hooks/prebuild/
  2020/08/12 21:03:46.674296 [INFO] Following platform hooks will be executed in order: [01_installations.sh]
  2020/08/12 21:03:46.674302 [INFO] Running platform hook: .platform/hooks/prebuild/01_installations.sh
  2020/08/12 21:03:46.674482 [ERROR] An error occurred during execution of command [app-deploy] - [RunAppDeployPreBuildHooks]. Stop running the command. Error: Command .platform/hooks/prebuild/01_installations.sh failed with error fork/exec .platform/hooks/prebuild/01_installations.sh: permission denied  
  </code></pre>
  <p><strong>Question</strong></p>
  <p>My understanding is that permissions were denied because I did not add <code>chmod +x</code> to make the .sh file executable. As the AWS documentation on platform hooks states: &quot;Use chmod +x to set execute permission on your hook files.&quot; (<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/platforms-linux-extend.html" rel="noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/platforms-linux-extend.html</a>). <strong>My question is: how do I do this?</strong></p>
  <p>I simply have the .sh file in a directory. I do not call it from anywhere else. Is there a simple step I'm missing? The AWS documentation makes it seem like it should be straightforward.</p>
  <p><strong>Previous Attempts</strong></p>
  <p>Things I have tried:</p>
  <ol>
  <li>Adding .ebextensions
  <ul>
  <li>Attempt: Create a <code>.config</code> file in the <code>.ebextensions</code> directory with the below command which should execute the .sh file with chmod +x permissions.</li>
  <li>Result: The same error occurs. The Elastic Beanstalk logs do not indicate that the <code>.config</code> was processed at all.</li>
  </ul>
  </li>
  </ol>
  <pre><code>container_commands:
      01_chmod1:
          command: &quot;chmod +x .platform/hooks/prebuild/01_installations.sh&quot;
  </code></pre>
  <ol start="2">
  <li>Changing the name of the .sh file
  <ul>
  <li>Attempt: Change the .sh file to be named &quot;chmod +x 01_installations.sh&quot; as suggested by an AWS user (forums link below). Remove the .ebextensions</li>
  <li>Result: The same error occurs.</li>
  </ul>
  </li>
  </ol>
  <pre><code>[RunAppDeployPreBuildHooks]. Stop running the command. Error: Command .platform/hooks/prebuild/chmod +x 01_installations.sh failed with error fork/exec .platform/hooks/prebuild/chmod +x 01_installations.sh: permission denied 
  </code></pre>
  <p>I have reviewed the ideas here, but none of them actually include complete enough examples to follow:</p>
  <ul>
  <li><a href="https://forums.aws.amazon.com/thread.jspa?messageID=942515" rel="noreferrer">https://forums.aws.amazon.com/thread.jspa?messageID=942515</a></li>
  <li><a href="https://github.com/aws/elastic-beanstalk-roadmap/issues/15" rel="noreferrer">https://github.com/aws/elastic-beanstalk-roadmap/issues/15</a></li>
  </ul>