Docs‎ > ‎Best Practices‎ > ‎Espresso in the cloud‎ > ‎

install-espresso-in-the-amazon-cloud-aws


Espresso can easily be run in your Amazon Elastic Beanstalk environment. This page describes how to deploy it. 



Creating a New Instance

This process should take 2-3 minutes to configure, followed by a 20-minute wait for the service to come up.  It will create a new RDS instance (refer here for instructions on using an existing RDS instance).

1 - Obtain the URL to a version of Espresso (or obtain a WAR download)

2 - Log into your Amazon Console (typically at https://console.aws.amazon.com )

3 - Find Deployment & Management and Select the Elastic Beanstalk page 

4 - Click Create New Application 


5 - Enter an application name, e.g. "Acme's Espresso Logic", and click Next


6 - On the New Environment page, click Create web server

7 - Select a permission profile


8 - In the Environment Type page, select Predefined configuration: Tomcat and select the Environment type of your choice. Click Next



9 - In the Application Version page, select S3 URL and enter the URL you obtained in step 1 (or upload an Espresso WAR file), then click Next


10 - In the Environment Information page, enter an Environment name and an Environment URL, which will be the default address for your Espresso service (you can always alias it later). Click Next.



11 - In the Additional Resources page, check Create an RDS DB Instance with this environment. This will create a new RDS instance to store Espresso Logic's repository metadata. Click Next.

12 - In the Configuration Details page, select the desired options. Espresso can comfortably run in a micro instance, but it will take full advantage of any additional CPUs you allocate. Any memory in excess of 4GB will not be used, however. Click Next.


13 - If, in step 8, you selected Environment Type: Load balancing, auto scaling, you will now have an option called Application health check URL. The correct value is /rest/abl/admin/v2/@heartbeat

14 - In the Environment Tags page, you can tag your new service if desired. Click Next.


15 - In the RDS Configuration page, configure your database instance as desired. A micro instances should be fine for most applications. Write down your user ID and password in case you need it later. Click Next.


16 - In the Review page, make sure all settings are as desired and click Launch.

The creation of the service can take up to 20 minutes, mostly because of the creation of the new RDS instance.


After a while, the Health icon should turn green -- congratulations, you now have your own Espresso service. You should be able to click on its URL.



At this point, Elastic Beanstalk will have created one (or more) EC2 instance(s), an RDS instance, a load balancer, an elastic IP address, and a security group. You can modify any of these, but if you make changes to the EC2 instance(s), keep in mind that these changes may be lost if you use auto-scaling.


Using an existing RDS MySQL database

The instructions above include the creation of a new MySQL RDS instance. A micro instance is very cheap, but perhaps you already have an existing RDS instance that you'd like to use, rather than creating a new one. Here's how to do that.

Open a Remote Connection for your IP 

If you want to use MySQL Workbench or any tool on your local desktop - you will need to add your IP address to the security group of the RDS MySQL instance (shown below).



1 - You can skip steps 11 and 14

2 - Once the service is created, it will not start successfully because it doesn't have access to an admin database -- this is normal.

3 - Connect to your MySQL RDS instance and create a new database (call it anything you want)

4 - Also create a MySQL user who has full access to that new database

5 - You will need to make sure that your Espresso service is authorized to connect to that RDS instance -- the RDS instance's security group should include the newly created security group for the Espresso service.  See the MySQL section of this page.

6 - Open the Configuration page for your new application

7 - Click the gear icon next to Software Configuration

8 - In the Environment Properties section, you'll need to define 5 new environment properties:

 RDS_HOSTNAME The hostname of your RDS server
 RDS_PORT The port used to access your RDS server, normally 3306
 RDS_DB_NAME The name of the database you created
 RDS_USERNAME The name of the MySQL user you created
 RDS_PASSWORD The password of the MySQL user you created

Once you click Save, you may have to restart the application for these changes to take effect. If things are configured properly, the application should come online after 2-3 minutes.
If it does not, you'll need to look at the log files to determine what the problem is.