amazon-elastic-beanstalk
How do you run a worker with AWS Elastic Beanstalk?
As @chris-wheadon suggested in his comment, you should try to run celery as a deamon in the background. AWS Elastic Beanstalk uses supervisord already to run some deamon processes. So you can leverage that to run celeryd and avoid creating a custom AMI for this. It works nicely for me. What I do is to … Read more
AWS Elastic Beanstalk, running a cronjob
This is how I added a cron job to Elastic Beanstalk: Create a folder at the root of your application called .ebextensions if it doesn’t exist already. Then create a config file inside the .ebextensions folder. I’ll use example.config for illustration purposes. Then add this to example.config container_commands: 01_some_cron_job: command: “cat .ebextensions/some_cron_job.txt > /etc/cron.d/some_cron_job && … Read more
SSH to Elastic Beanstalk instance
I found it to be a 2-step process. This assumes that you’ve already set up a keypair to access EC2 instances in the relevant region. Configure Security Group In the AWS console, open the EC2 tab. Select the relevant region and click on Security Group. You should have an elasticbeanstalk-default security group if you have … Read more
How do you pass custom environment variable on Amazon Elastic Beanstalk (AWS EBS)?
As a heads up to anyone who uses the .ebextensions/*.config way: nowadays you can add, edit and remove environment variables in the Elastic Beanstalk web interface. The variables are under Configuration → Software Configuration: Creating the vars in .ebextensions like in Onema’s answer still works. It can even be preferable, e.g. if you will deploy … Read more
Beanstalk: Node.js deployment – node-gyp fails due to permission denied
Solution The solution is to add the file .npmrc to the application with the content: # Force npm to run node-gyp also as root, preventing permission denied errors in AWS with npm@5 unsafe-perm=true (Or configuring npm so in any other way. (Though setting npm_config_unsafe_perm=true in /opt/elasticbeanstalk/env.vars did not work for me.) Explanation npm install is … Read more
How to force https on elastic beanstalk?
This answer assumes you have already enabled https in the load balancer security group, added the SSL certificate to the load balancer, have both ports 80 and 443 being forwarded by the load balancer, and pointed your domain name at the Elastic Beanstalk environment with Route 53 (or equivalent DNS service). Option 1: Do the … Read more
Increasing client_max_body_size in Nginx conf on AWS Elastic Beanstalk
There are two methods you can take for this. Unfortunately some work for some EB application types and some work for others. Supported/recommended in AWS documentation For some application types, like Java SE, Go, Node.js, and maybe Ruby (it’s not documented for Ruby, but all the other Nginx platforms seem to support this), Elasticbeanstalk has … Read more