Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ metadata:
cloud-platform.justice.gov.uk/slack-alert-channel: "dps_alerts_non_prod"
cloud-platform.justice.gov.uk/application: "HMPPS Prisoner cell allocation"
cloud-platform.justice.gov.uk/owner: "moveaprisoner@digital.justice.gov.uk"
cloud-platform.justice.gov.uk/source-code: "https://github.com/ministryofjustice/hmpps-change-someones-cell.git"
cloud-platform.justice.gov.uk/team-name: "Move a Prisoner"
cloud-platform.justice.gov.uk/source-code: "https://github.com/ministryofjustice/hmpps-change-someones-cell.git,https://github.com/ministryofjustice/hmpps-change-someones-cell-api"
cloud-platform.justice.gov.uk/team-name: "move-a-prisoner"
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,16 @@ spec:
kind: ClusterIssuer
dnsNames:
- change-someones-cell-dev.prison.service.justice.gov.uk
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: hmpps-change-someones-cell-api-cert
namespace: hmpps-prisoner-cell-allocation-dev
spec:
secretName: hmpps-change-someones-cell-api-cert
issuerRef:
name: letsencrypt-production
kind: ClusterIssuer
dnsNames:
- change-someones-cell-api-dev.hmpps.service.justice.gov.uk
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,21 @@ module "hmpps-change-someones-cell" {
kubernetes_cluster = var.kubernetes_cluster
github_owner = var.github_owner
}

module "hmpps-change-someones-cell-api" {
source = "github.com/ministryofjustice/cloud-platform-terraform-hmpps-template?ref=1.2.1"
force_rotate_token = true
custom_token_rotation_date = "2026-03-20"
github_repo = "hmpps-change-someones-cell-api"
application = "hmpps-change-someones-cell-api"
github_team = var.github_review_team
environment = var.deployment_environment
is_production = var.is_production
protected_branches_only = true
application_insights_instance = var.deployment_environment
source_template_repo = "hmpps-template-kotlin"
github_token = var.github_token
namespace = var.namespace
kubernetes_cluster = var.kubernetes_cluster
github_owner = var.github_owner
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/*
* Postgres for hmpps-change-someones-cell-api, which takes over cell move orchestration from
* whereabouts-api. An RDS instance previously existed in this namespace for the retired
* hmpps-prisoner-cell-allocation-api and was removed in 14b0db32ab (MAP-1366); this largely
* restores it.
*
* Make sure that you use the latest version of the module by changing the `ref=` value in the
* `source` attribute to the latest version listed on the releases page of this repository.
*/
module "rds" {
source = "github.com/ministryofjustice/cloud-platform-terraform-rds-instance?ref=9.2.0"

# VPC configuration
vpc_name = var.vpc_name

# RDS configuration
allow_minor_version_upgrade = true
allow_major_version_upgrade = false
performance_insights_enabled = false
db_max_allocated_storage = "500"
enable_rds_auto_start_stop = true

# PostgreSQL specifics
db_engine = "postgres"
db_engine_version = "18"
rds_family = "postgres18"
db_instance_class = "db.t4g.micro"
prepare_for_major_upgrade = false

# Tags
application = "hmpps-change-someones-cell-api"
business_unit = var.business_unit
environment_name = var.environment
infrastructure_support = var.infrastructure_support
is_production = var.is_production
namespace = var.namespace
team_name = var.team_name
}

resource "kubernetes_secret" "rds" {
metadata {
name = "rds-postgresql-instance-output"
namespace = var.namespace
}

data = {
rds_instance_endpoint = module.rds.rds_instance_endpoint
database_name = module.rds.database_name
database_username = module.rds.database_username
database_password = module.rds.database_password
rds_instance_address = module.rds.rds_instance_address
}
}

# Configmap to store non-sensitive data related to the RDS instance
resource "kubernetes_config_map" "rds" {
metadata {
name = "rds-postgresql-instance-output"
namespace = var.namespace
}

data = {
database_name = module.rds.database_name
db_identifier = module.rds.db_identifier
}
}
Loading