Category: Deployment

Q: Change tmp folder permission when deploying Cakephp application to AWS elastic beanstalk

Hi, This is my first time asking question on Aero Coding.

I don't know if someone has done this already.. but I want to change tmp folder permission to writable automatically when overtime I deploy Cakephp application to AWS elastic beanstalk. 

At this moment, I have to set permissions via SSH tunnel manually and this is not I want because I am planning to do scaling with eb. Can someone help me? Thanks

aws beanstalk file permission
1 Answers

Version: 2.8.0

I don't know about beanstalk that much, but to config you have to implement .ebextensions doc to set configuration options. Hence, for example, you can set chmod -R command in {some file name}.config:

option_settings:
  - option_name: ENV
    value: production

files:
  "/opt/elasticbeanstalk/hooks/appdeploy/post/99_make_storage_writable.sh":
    mode: "000755"
    owner: root
    group: root
    content: |
      #!/usr/bin/env bash
      chmod -R 755 /var/www/yourpath

The config script will run before deployment.