The NHS e-Referral Service (e-RS) combines electronic booking with a choice of place, date and time for first hospital or clinic appointments.

e-RS was hosted on a mixed Node 4 (co-located physical data centre) and Rackspace infrastructure. An optimisation review identified that the bult infrastructure was not scalable, that ’clean’ build servers could not be repeatedly deployed in a timely fashion, and that the infrastructure was not ’self-healing’. The review also highlighted that build times could be reduced with more powerful servers.

BJSS proposed migrating all application build/deployment services to AWS

This included Jenkins build master and slave(s), Selenium grid, SonarQube test environment, Crucible/Fisheye code review tools, Git code repository, Nexus artefact repository and Puppet configuration management.

The infrastructure was designed with scalability and elasticity in mind, with a view to enabling deployment of full staging environments and accommodating future requirements.

An important aspect of the engagement was to have all the infrastructure documented as code, using Terraform, to facilitate tracking of the state of the infrastructure, recreating environments as part of Disaster Recovery, and auditing deployed infrastructure. All infrastructure deployments take place from a centralised Jenkins build server to ensure that important information is held centrally, and to prohibit the ad-hoc deployment of infrastructure not defined in code.

As with all e-RS application code in e-RS, deployment code is peer-reviewed and undergoes requisite testing.

Our solution uses several AWS services

In addition to these AWS services, e-RS also relies on several third party applications and solutions.

Terraform allows for the coding of the AWS infrastructure, enabling infrastructure to be easily replicated, moved in the case of a failure, and tracked. Terraform reduced the effort required and ensuring consistent quality of code across the organisation.

Also, Packer creates AWS machine images (AMIs) and allows for the coding configuration. While Terraform is responsible for creating an instance (virtual machine) from the AMI, and Puppet is responsible for deploying the application, Packer is responsible for getting the machine image to a state where Puppet can be run.

AWS CloudTrail

Logs all API Calls, providing an audit trail for all deployment activities.

Amazon CloudWatch

Monitors several metrics to ensure only authorised security changes are applied.

Amazon EBS

Provides file storage for Git instances; should the instance terminate a new instance is provisioned and automatically attaches/mounts the volume.

Amazon EC2

On-demand EC2 instances combined with Auto-Scaling Group policies provide scalability and elasticity.

AWS Identity & Access Management

Enforces security policy, ensuring only authorised DevOps staff can deploy/release code.

Amazon RDS

The back-end data repository for all services. The solution takes advantage of features such as mult-az high availability to meet project SLAs.

Amazon Route 53

Enables simplified and more unified code.

Amazon S3

Used to store backup snapshots, Jenkins build histories, and log files.

Amazon EC2 Security Groups

Provides an additional layer of fine grain security controls by restricting network traffic between specific services on specific ports.

Amazon VPC

Provides security and network isolation.


The delivery built confidence in migrating other NHS applications into the Cloud

To establish confidence in the AWS platform, and the reputation for accelerated deployment, it was important to demonstrate the migration of one service as quickly as possible without disruption to the DevOps team. This was achieved by the end of the second (two week) Sprint.

The primary driver was reduced build time. With a focus on outcomes, and tather than spending time attempting to accurately size build slaves, with the associated risk of under-specifying, the initial build employed the largest “C” class Amazon EC2 instances and retrospectively optimised once performance baselines were established.

The bjss e-rs delivery


Reduction in full application stack build time


Reduction in operational support demand


Reduction in infrastructure cost