AWS Elastic Beanstalk: Difference between revisions

From Littledamien Wiki
Jump to navigation Jump to search
Line 20: Line 20:


=== Web app environment variables ===
=== Web app environment variables ===
Any variables needed by the app can be stored here. E.g. `LETSENCRYPT_DOMAIN` for the purposes of installing a security certificate, or RDS connection properties.


* '''AWS Management Console''' > '''Elastic Beanstalk''' > ''web app environment'' > '''Configuration''' > '''Software''' Group > '''Edit'''
* '''AWS Management Console''' > '''Elastic Beanstalk''' > ''web app environment'' > '''Configuration''' > '''Software''' Group > '''Edit'''
* Scroll down to '''Environment Properties''' at the bottom
* Scroll down to '''Environment Properties''' at the bottom
* Enter key/value pairs as needed
* Enter key/value pairs as needed
<p class="alert alert-info">These key/value pairs can be created in an `.ebextensions` config file, but should be created manually if they contain sensitive information.</p>


== Upgrading the platform of an Elastic Beanstalk instance ==
== Upgrading the platform of an Elastic Beanstalk instance ==

Revision as of 14:10, 6 June 2020

Configuration

Web application configuration files

Configuration is stored in [project_root]/.elasticbeanstalk/config.yml.

This file should not be included in git repo.

The Elastic Beanstalk (EBS) application and environment names are specified in this yaml file. This is determines these properties for the AWS eb cli.

Security rules

AWS Console > EC2 > instances > instance linked to EBS environment > details > click on security group > inbound rules tab

Open up the SSH port (22) to specific public IP of the local development LAN. e.g. XX.XX.XX.XX/32 where XX.XX.XX.XX is the IPv4 public address.

Open up the HTTPS port (443) to all IP addresses, e.g. 0.0.0.0/0 and ::/0

Note that this configuration can be placed in an .ebextensions config file. See Open the HTTPS port for Let's Encrypt certificates.

Web app environment variables

Any variables needed by the app can be stored here. E.g. LETSENCRYPT_DOMAIN for the purposes of installing a security certificate, or RDS connection properties.

  • AWS Management Console > Elastic Beanstalk > web app environment > Configuration > Software Group > Edit
  • Scroll down to Environment Properties at the bottom
  • Enter key/value pairs as needed

These key/value pairs can be created in an .ebextensions config file, but should be created manually if they contain sensitive information.

Upgrading the platform of an Elastic Beanstalk instance

  • AWS Management Console > Compute > Elastic Beanstalk
  • Click on an EB instance
  • Under Platform on the left click the Change button.
  • Select the new platform from the dropdown and click Save

Troubleshooting

403 HTTP error

Receiving a 403 error when attempting to load the hosted site indicates that something unintended was uploaded to the root of the web directory.

SSH to the server to confirm the content of that directory, e.g. /var/www/html/.