AWS ElasticBeanstalk Symlink

eb config
aws:elasticbeanstalk:command
aws elastic beanstalk
aws cli elastic beanstalk
aws elastic beanstalk precedence
ebextensions elastic beanstalk
aws config elastic beanstalk
aws elastic beanstalk manifest

I don't want to place my config/database.yml file in GITHUB, rather to have it somewhere in the somewhere and do the symlink like below

config/databse.yml -> /var/www/database.yml

In the .elasticbeanstalk/00packages.config, I have following stuffs

commands:
  # install WKHTML
  03_command:
    command: yum install xz urw-fonts libXext openssl-devel libXrender
  04_command:
    command: wget http://download.gna.org/wkhtmltopdf/0.12/0.12.3/wkhtmltox-0.12.3_linux-generic-amd64.tar.xz
  05_command:
    command: tar -xJf wkhtmltox-0.12.3_linux-generic-amd64.tar.xz
  06_command:
    command: cp wkhtmltox/bin/wkhtmltopdf /usr/local/bin/wkhtmltopdf
  07_command:
    command: cp wkhtmltox/bin/wkhtmltoimage /usr/local/bin/wkhtmltoimage

Can I add symlink stuff here and does it work

Unfortunately, none of the EB custom configurations allow you to perform operations after your application has been deployed. At the point at which commands are run, your application is still in /var/app/ondeck, so if you create a symlink under /var/app/current, it will be deleted when ondeck is renamed to current.

The only way around this limitation that I'm aware of is to put a file into the appdeploy/post hooks directory. In your case, it would look something like this:

.ebextensions/01symlink.config

files:
  "/opt/elasticbeanstalk/hooks/appdeploy/post/99_create_symlink.sh":
    mode: "000755"
    owner: root
    group: root
    content: |
      #!/usr/bin/env bash
      ln -sf /var/www/database.yml /var/app/current/config/database.yml

Alternately, you could use a commands entry to copy the file from /var/www to /var/app/ondeck during the deploy.

"eb deploy" does not deploy symlinks if, Forum: AWS Elastic Beanstalk >Thread: "eb deploy" does not deploy symlinks I noticed symlinks were no longer being deployed when I run "eb Is there a way I can use .ebignore and deploy symlinks at the same time? Elastic Beanstalk is the fastest and simplest way to deploy your application on AWS. You simply use the AWS Management Console, a Git repository, or an integrated development environment (IDE) such as Eclipse or Visual Studio to upload your application, and Elastic Beanstalk automatically handles the deployment details of capacity provisioning, load balancing, auto-scaling, and application health monitoring.

I was able to create a symlink using container_commands and a relative path, which is your app's root directory by default. Although the /var/app/current directory does not exist, you can create a symlink and it will get moved to /var/app/current when the deploy completes. For example:

container_commands: 01symlink: command: sudo -u webapp ln -sf /var/www/database.yml ./config/database.yml

Customizing software on Linux servers, to an application directory in an AWS Elastic Beanstalk environment. To create a symlink from /efs that points to the staging directory, use  Note: After deployment, the symlink points to the application directory. (Option 2) Create a symlink to an application directory after the flip script moves the contents of the staging directory to the application directory. To create a symlink that points to the application directory, create a .config file in your .ebextensions folder. See the

An better and far simpler solution is to use the DATABASE_URL environmental variable to configure the database connection. This is how Heroku for example "magically" connects your app to the database created by its postgres addon.

For example:

postgresql://somehost/some_database?username=foo&password=bar

Just leave the bare minimum in database.yml:

default: &default
  adapter: postgresql
  encoding: unicode
  pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
development:
  <<: *default
  database: myapp_development
test:
  <<: *default
  database: myapp_test
production:
  <<: *default

This makes it perfectly safe to check into version control.

And then set the env var through environmental properties on AWS.

Mount Amazon EFS Volumes to Application Directories in Elastic , ebignore causes the EB CLI to follow symbolic links and include the linked file when creating a source bundle. This is a known issue and will be fixed in a future​  AWS Elastic Beanstalk endpoints and quotas The following are the service endpoints and service quotas for this service. To connect programmatically to an AWS service, you use an endpoint.

Configure the EB CLI - AWS Elastic Beanstalk, Elastic Beanstalk is launching the sample application instead. /mwunderl/ebcli/​environments/test/.elasticbeanstalk/logs/150630_201410 Updated symlink at  Customizing software on Linux servers. Use the first three digits for symlinks and the last three digits for setting permissions. "aws-elasticbeanstalk-ec2

Managing Elastic Beanstalk environments with the EB CLI, AWS Elastic Beanstalk lets you link your environments to share information between components that depend on one another. Note. Elastic Beanstalk currently  AWS Elastic Beanstalk Drupal 8 Install Error: failed to create symbolic link 'sites/default/files': amazon-web-services amazon-elastic-beanstalk drupal-8.

Creating links between Elastic Beanstalk environments, Attempting to follow the instructions at http://docs.aws.amazon.com/​elasticbeanstalk/latest/dg/php-hawordpress-tutorial.html, environment creation consistently  AWS Elastic Beanstalk is the perfect environment to use due to the fact that it is highly available out of the box. Rather than relying on a single cloud instance, Elastic Beanstalk automatically configures servers in different AWS Availability Zones and sets up Elastic Load Balancing for load management.