44

The cleanest way I found is to use a .ebextensions config file in my project archive: Sample .ebextensions/project.config file: files: "/etc/php.d/project.ini" : mode: "000644" owner: root group: root content: | upload_max_filesize = 64M post_max_size = 64M When the application version is deployed, this will write a custom ...


25

The "selected" answer is correct, but I wanted to add some extra information as most people using EB and RDS together should have the same requirement too - even if they don't know it yet. First question: Why would you want the RDS instance to exist outside the EB environment? Answer: So that the lifetime of the RDS instance is not tied to the lifetime of ...


22

The simple and cool solution here is to put your ELB behind CloudFront. If the origin server (the ELB in this case) throws a 5XX error (or 4XX if you like), CloudFront can return a custom error page, which you can configure CloudFront to fetch from an S3 bucket by creating a second origin pointing to the bucket and creating a cache behavior routing (e.g.) /...


19

You need a NAT. This configuration is commonly used to support private subnets in VPC, there's quite a detailed guide here. Once your VPC is configured to use the NAT instance all the outbound traffic will be attributed to the EIP of the NAT instance. If so, does that instance need to be solely for this purpose or can it be one of the instances that's ...


18

First off, to be clear, no Elastic Beanstalk is not PaaS in the way you are thinking about it. If you break it into pieces, it's really more like having virtualized instance templates and application deployment automation like puppet or chef. Along with this you get automated access to awe's load balancer service, and cloud watch monitoring, that allows ...


18

Answer from the AWS support: In order to associate an existing database to a EB Environment you have to take a snapshot of it via the Management Console and then choose "create a new RDS database" under the Data Layer. There does not appear to be a way to associate a running RDS instance to an existing EB Environment without launching a new one from a ...


16

All prices below are current as of 26th June 2017 and may change. Q1: Route53 is a DNS service, not a domain registration service. To host DNS with Amazon, there is a flat fee of $0.50 per month, or $6 per year, per domain for use of the Route53 DNS service. Depending on the number of queries your domain receives, there are additional charges. $0.40 per ...


13

I understand this is an old thread - for someone who has a similar use-case now, AWS nat-gateway would be a better solution.


13

If you know how to fix the source of problem (for example: change application settings in Beanstalk Environment variables or deploy fixed version of your application), then: Go to page Auto Scaling Group, choose your region, find Auto Scaling Group by Beanstalk Environment ID (like e-abcd12345). In Details tab, push "edit", set Desired, Min and Max to 0. ...


12

The point of keeping secrets out of source code is so they don't go into source control. This is particularly useful in open source projects. When deployed, it doesn't matter if the secret's in a file or envvar. What's important is that only the OS user that your program is running as can read it. This is the default for envvars, which is convenient. Root ...


11

Not a console view, but it is (now) visible in the logs. .ebextensions/10-log.config container_commands: 05-whoami: command: "whoami" /var/log/cfn-init.log after deployment 2014-07-01 22:08:10,695 [DEBUG] Running command 05-whoami 2014-07-01 22:08:10,695 [DEBUG] Generating defaults for command 05-whoami 2014-07-01 22:08:11,014 [DEBUG] Defaults ...


11

I've evaluated Elastic Beanstalk in addition to other AWS offerings while trying to improve our hand-rolled AWS instances. The reasons I chose not to use it were due to complications that would arrise migrating my existing application and not with the offering itself. The catch is that you don't have as much control about application deployment / ...


11

You can add AWS Elastic Beanstalk configuration files (.ebextensions) to your web application's source code to configure your environment and customize the AWS resources that it contains. The option_settings section of a configuration file defines values for configuration options. Configuration options let you configure your Elastic Beanstalk environment, ...


11

You should be able to use what you have in that config file for the launchconfiguration namespace, but you need the single quotes around the namespace and value like you have in the first 2 that are working. - namespace: 'aws:autoscaling:launchconfiguration' option_name: InstanceType value: 't2.micro' - namespace: 'aws:autoscaling:launchconfiguration'...


11

Usually, there's no way to recover from an invalid state for a given environment. In such cases, you need to go to the current environment page, click on the Actions button, select Clone Environment, and then wait for the clone environment to be created. Once it's ready, you can go to the application page, click on the Actions button and then select SWAP ...


11

Q: Can I use certificates on Amazon EC2 instances or on my own servers? No. At this time, certificates provided by ACM can only be used with specific AWS services. Q: With which AWS services can I use certificates provided by ACM? You can use ACM with the following AWS services: • Elastic Load Balancing • Amazon CloudFront ...


11

Not as of now, no. The answer to the question is slightly hidden, under an entirely different question in the ACM FAQ: Q: Can I use the same certificate in more than one AWS Region? It depends on whether you’re using Elastic Load Balancing or Amazon CloudFront. If you want to use a certificate with Elastic Load Balancing for the same site (the same ...


10

It is also possible to do that somewhat more easily, without touching the load balancer, by using the X-Forwarded-Proto header set by ELB. Here is what I ended up doing : files: "/etc/nginx/sites-available/elasticbeanstalk-nginx-docker-proxy.conf": mode: "00644" owner: root group: root content: | map $http_upgrade $connection_upgrade ...


9

You're using a Macintosh, and you let the hidden __MACOSX directories get into your deployment. These files are generated when you zip up a directory to hold the OS X specific resource forks, which are useless on any other operating system. If you're going to use zip to package your app for deployment, you need to remove these Better to use git, Capistrano, ...


9

You can use Elastic Beanstalk along with a VPC for your scenario. Use a VPC with public and private subnets. Add a NAT to a public subnet and give it an Elastic IP address. Ensure all traffic from the private subnets goes through your NAT. Create your Elastic Beanstalk application, placing the ELB in a public subnet and the EC2 instances in one or more ...


9

I've just come across this problem too. I found that a postinstall script would not run but a prestart would. Mine looks like this: "scripts": { "start": "node index.js", "prestart": "node node_modules/webpack/bin/webpack.js" } That now correctly bundles my webpack stuff before starting the server when I run eb deploy locally.


9

When using the environment type "Single instance", you always get an EIP. From Beanstalk developer guide, Environment Types: A single-instance environment contains one Amazon EC2 instance with an Elastic IP address. Disabling the "Associate Public IP Address" option does not have any effect. Switch to "Load-balancing, Autoscaling" Environment to get by ...


9

The answer was rather silly. A little gotcha: I didn't notice that I'd changed my region when I created the SSL Certificate, so the ELB and the certificate regions didn't match. I deleted the cert, switched region to match my ELB instance, and then requested a new one. Worked as expected! Doh.


8

I've figured it out and I feel a little bit silly for not picking this up sooner. So for anyone that uses AWS::CloudFormation::Authentication path, the solution of course is: Make sure your BUCKET policy allows your aws-elasticbeanstalk-ec2-role. DOH!! It should look something like this: { "Id": "Policy1111Blah", "Version": "2012-10-17", "...


8

I solved this problem by going to Elastic Beanstack, my app was GRAY status/health, from the app overview I accessed the Actions button and Aborted the current operation. Then I got the health status GREEN, and managed to deploy.


8

It's a NAT rule. iptables -L -t nat Chain PREROUTING (policy ACCEPT) target prot opt source destination REDIRECT tcp -- anywhere anywhere tcp dpt:http redir ports 8080 REDIRECT tcp -- anywhere anywhere tcp dpt:http redir ports 8080 REDIRECT tcp -- anywhere ...


8

You can customize packages that are installed and commands that are run on deploy with .ebextensions For yarn, I created a file with the following commands which install a recent node version and yarn: # .ebextensions/yarn.config commands: 01_install_node: command: | sudo curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash ...


7

In order to make this work I had to run the command from a file using the post deployment hooks commands: create_post_dir: command: "mkdir /opt/elasticbeanstalk/hooks/appdeploy/post" ignoreErrors: true files: "/opt/elasticbeanstalk/hooks/appdeploy/post/99_restart_workers.sh": mode: "000755" owner: root group: root content: | ...


7

I think you need to specify what Elastic Beanstalk environment that you use (see: Supported Platforms), because different environment has different configuration. Basically, you need to customize: Elastic Load Balancer: Listen on port 80 and proxy it to EC2 instance port 80. Listen on port 443 and proxy it to EC2 instance port 443. EC2 Web Server/Proxy: ...


7

Currently, there's no easy way to suspend an environment. There's also no easy way to have a maintenance page for your environment while your instances are down. When you set the number of instances to 0, the instances will terminate but you'll have to do this all manually as the EB console does not allow an entry of 0. You can do this by running this: as-...


Only top voted, non community-wiki answers of a minimum length are eligible