The Cloud Platform HMPPS Template module
The Cloud Platform HMPPS Template
To simplify the deployment of applications to Cloud Platforms, a module has been created that contains most of the namespace configurations required to deploy projects based on the Kotlin and Typescript templates, although it can also be used for other projects.
This can be found here: cloud-platform-terraform-hmpps-template
It is intended that each application in each namespace will have a corresponding Terraform file that refers to this module with the appropriate configurations for the application.
The key element to this is that it will populate secrets for that environment in the github repository to enable it to deploy to the Kubernetes platform:

It will also provide some default secrets for the application (eg. Application Insights) and provide control over deployment, including who can deploy (by Github team) and which branches may be deployed.
Requirements
The configuration of the module is carried out by assignment of variables. Almost all of these are mandatory, so it is worth checking the Kotlin and Typescript template files to see.
The simplest way to do this is to take the appropriate template file and copy it to whichever namespaceyou’ll be deploying to (within a new branch of Cloud Platform Environments). Then make the modifications as detailed below.
Configuration
Copy the file
First of all, copy the Kotlin or Typescript template (depending on app; if you’re not using a template, the Kotlin one is the best one to use, since it doesn’t include Redis) into your namespace, and rename it to the github repo to which it will apply.
Modify the fields
Mandatory fields
github_repo =
“your github repository”application =
“your application”github_team =
“your github team”application_insights_instance =
"dev, preprod or prodsource_template_repo =
“hmpps-template-typescript or hmpps-template-kotlin” This is required to deploy the correct Application Insights configuration
Default fields
is_production = var.is_production
This inherits theis_production
namespace variableenvironment = var.environment
namespace variable for the environment; this must match the environment name used in helm values file e.g. values-dev.yaml
Optional fields
-
reviewer_teams =
[“List”, “Of”, “Github”, “Teams”] If this is set, only the teams listed will be allowed to deploy to this environment. Comment it out if it’s not needed -
selected_branch_patterns =
["branch, "patterns/"] If this is set, the selected branches will be allowed to be deployed. -
protected_branches_only = true
Comment this out if selected branches is in use
Note: One or other of the above needs to be set.
Once this is complete, raise a PR to have it merged, and - once the Terraform has been run - your Github Repository will have a namespace configured for it, including the appropriate secrets for deployment.
Further reading
More information on the Cloud Platform HMPPS Template can be found in the Github Project’s README.
This page was last reviewed on 27-Jan-2025, next review will be on 01-Jul-2025.Edit this page here.