The DuraCloud web applications are run using AWS Elastic Beanstalk. This service manages the deployment of the applications, the configuration of load balancing, and the configuration of auto-scaling. The first step is to create an Elastic Beanstalk environment, followed by the configuration of each component.
- Go to the Beanstalk Service in the AWS console
- Select
Create New Application
- Give it a name and description (e.g. DuraCloud)
- Click
Create web server
- Select
Tomcat
platform,Tomcat 8.5 with Corretto 11 running on 64bit Amazon Linux 2
platform branch and4.2.10
version - Select the
Sample application
(it will be replaced by DuraCloud apps in a later step), and keep the default deployment preferences - Take defaults for environment name and URL (or update them if you'd prefer.) The environment URL must be unique.
- Leave additional resources unchecked
- Click on
Configure more options
- Under
Presets
click high availability - Edit
VPC
section and select your VPC and subnets and click save - Edit
Load Balancer
select application load balancer. Add a listener with https, port 443 and your *. certificate. Edit the default process and change the health check path to /duradmin/login - Edit
Manage Updates
disable managed updates. - Click "Edit" in the
Software
section and select Apache under Container Options and enter the following Environmental Variables:- key: S3_CONFIG_BUCKET
- value:
<your-s3-config-bucket>
- key: AWS_REGION
- value:
<your-aws-region>
(make sure to use a valid EC2 region code)
- value:
- key: S3_CONFIG_BUCKET
- Edit
Capacity
0. selectLoad balanced
Environment type 0.min
instances to2
0.max
instances to5
0.m5.large
instance type 0.scaling cooldown
to360
. 0. Scaling Triggers: *Metric
:CPUUtilization
*Statistic
:Average
*Unit
:Percent
*Period
:1
*Breach Duration
:5
*Upper threshold
:70
*Scale up Increment
:1
*Lower threshold
:20
*Scale-down increment
:-1
- Edit
Notifications
, enter an email address - Edit
Security
, set your keypair and IAM instance profile - Edit
Monitoring
- Enable
Ignore application 4xx
- Enable
Ignore load balancer 4xx
- Enable
- Click
Create Environment
- Navigate to
Configuration -> Software
and set the followiwng:- jvm command line params:
-Dduracloud.config.file=s3://<your-s3-config-bucket>/path-to-duracloud-properties-file
- jvm command line params:
There are a couple of additional configurations you'll need to make in EC2 -> Load Balancer section in order to support sticky sessions with an Application Load Balancer.
- Click on your DuraCloud autoscaling group
- Scroll down to
Load Balancing
and click on the target group. - Click on the
Attributes
tab and hitEdit
- Select
Application-based cookie
underStickiness type
- Set the
App cookie name
toJSESSIONID
- Save changes.
You are now ready to deploy the DuraCloud beanstalk zip. You can do so by following the instruction in "Deploy to Production" detailed in this document.
In order to configure SSL, you must first have a valid SSL certificate for your domain.
- It is recommended that a wildcard SSL certificate be used, as that will allow all subdomains to be covered.
- The SSL certificate can be created through Route 53, if Route 53 is your domain registrar (or if you've transferred control of your domain to Route 53.) If not using Route 53, you will need to purchase an SSL certificate from a certificate authority. SSL certificates are often available from domain registrars.
- If you are using Route 53 to create an SSL certificate, it is automatically included in IAM for use in Elastic Beanstalk. If you have used a different AWS account (such as another account in your AWS Organization) to register the domain, you will need to create the certificate from the AWS account used to run the DuraCloud infrastructure in order for it to be available in Beanstalk.
- If not using Route 53, you will need to import your certificate using thw AWS Certificate Manager (ACM).
- Once the certificate is in place in ACM, go back to Elastic Beanstalk -> Configuration -> Load Balancer -> Edit
- Select the 443 port and Edit, then in the dropdown below
SSL certificate
select your certificate - Select
Save
, thenApply
In order to connect to DuraCloud accounts via the expected URL:
- Register your preferred domain name via a domain registrar. This can be done using AWS Route 53.
- Log in to the domain registrar, open the zone file editor for your DuraCloud domain
- If you are using Route53 add an A ALIAS record, you can also use * here to map all future subdomains to the EB DuraCloud-Env. If you use an external DNS registrar, add a CNAME record for each account subdomain which points to your DuraCloud environment URL. (The DuraCloud environment URL can be found on the Elastic Beanstalk dashboard for your the DuraCloud application.)