Deploy ReportPortal in AWS with AWS CloudFormation

Jignesh Chhatbar
4 min readJul 13, 2020

--

Deploy ReportPortal in AWS with Cloudformation using EC2, RDS, VPC, S3, EBS, and Route53. This will enable to create your infrastructure as code as well as an easy upgrade to the latest versions that ReportPortal releases

Introduction

Testing frameworks are an essential part of any successful product delivery. A defect-free product reduces maintenance costs and testing efforts and provides a high Return On Investment (ROI) and fits well in Continuous Integration and Continuous Delivery and truly a delight for the engineering team and leadership. Having a good framework along with a great dashboard elevate teams to greatness. However, there’s no one dashboard fits all.

ReportPortal is a market-leading open-source tool that easily integrates with Test Frameworks, receives analytics in real-time, and accumulates all test results in one place including logs, history, attachments. Also, have easy integration with bug tracking systems and can track release readiness. With its in-built Artificial Intelligence capability, you can reduce time and cost to analyze failure scenarios.

Architecture Diagram

CloudFormation

Parameters: These are the input parameters(ReportPortalVersion, EnvironmentSize, DBEngineVersion, DBAllocatedStorage, DBName, DBUser, DBPassword, etc.) which will be used to deploy the ReportPortal in AWS. Many of these data can be store in AWS SSM Parameter Store as per your security requirement

Conditions: Conditions are used to create conditional infrastructure, for example, if you have not enabled HTTPS then Domain will not be added and a secure listener will not be added in ALB.

Conditions Block

Mappings: Mappings are used for VPC CIDR blocks, Region Map where we store the instance AMI id and InstanceSize (Environment Size) how big of an environment you want to deploy. All of this can be changed based on custom requirements.

mappings

Resources: Resources are the actual infrastructure that will be deployed in the AWS environment. it has several resources like VPC, Public and Private subnets, related IGs, RouteTables, Security Groups, EC2 Instance, RDS instance, EBS Volume, S3Role, S3User, S3UserKey, S3 Policy, ALB, Listener and DNS Record

Outputs: Output the correct URL based on the configuration selected in the parameter section, it will provide the correct output based on the selected parameters in the parameter section of cloud formation YAML

Deployment in AWS

Create Stack: Go to CloudFormation in AWS console and upload the reportportal-cfn.yml and enter all the necessary details as explained in the CloudFormation section. Below, I have deployed without SSL and without Domain. It creates all infrastructure for you and deploys the ReportPortal in 15 minutes with one click.

Create ReportPortal Stack animation
Create Stack

Update Stack: update a stack, in the below animation, I have updated the current stack to use the domain with SSL and domain without SSL. Navigate to console, update stack and modify the parameters and you are all set

Update ReportPortal stack with Domain with and without SSL
Update Stack with Domain with and without SSL

Update Version: As seen above we can similarly update ReportPortal to the newer version, currently in the repository that I have created supports from version 5.0.0 to 5.2.2.

Delete Stack: Navigate to console and Delete the Stack, this will delete all the infrastructure for you and clean up your AWS.

Delete Stack
Delete Stack

Conclusion:

ReportPortal is one of the best opensource solutions in the market for maintaining your results and can easily hook into your daily test run and even help to check the health of your product, I wanted to deploy this application to AWS in a way that it can be managed easily hence thought to go with AWS CloudFormation and maintain my application deployment seamlessly.

This is one way to deploy ReportPortal on AWS there can be other different ways, you can remove the EC2 and deploy all the RP services as ECS containers and scale-up also can be deployed in managed EKS to make it more resilient.

Hope this article helps you better understand ReportPortal and some of the AWS fundamentals. I will appreciate any feedback.

GitHub URL: https://github.com/chhatbarjignesh/reportportal-aws-cfn

ReportPortal Repositries: https://github.com/reportportal

--

--