Skip to content

Commit

Permalink
Merge pull request #28843 from ministryofjustice/CPR-541-person-match…
Browse files Browse the repository at this point in the history
…-dev

CPR-541-person-match-dev
  • Loading branch information
JunaedAhmedMOJ authored Jan 14, 2025
2 parents bb74068 + e486a12 commit b57e62d
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module "hmpps_person_match_irsa" {
source = "github.com/ministryofjustice/cloud-platform-terraform-irsa?ref=2.0.0" # use the latest release

# EKS configuration
eks_cluster_name = var.eks_cluster_name

# IRSA configuration
service_account_name = "hmpps-person-match-${var.environment}"
role_policy_arns = {
rds = module.hmpps_person_match_rds.irsa_policy_arn
}

# Tags
business_unit = var.business_unit
application = var.application
is_production = var.is_production
team_name = var.team_name
namespace = var.namespace # this is also used to attach your service account to your namespace
environment_name = var.environment
infrastructure_support = var.infrastructure_support
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
module "hmpps_person_match_rds" {
source = "github.com/ministryofjustice/cloud-platform-terraform-rds-instance?ref=8.0.1"
vpc_name = var.vpc_name
team_name = var.team_name
business_unit = var.business_unit
application = var.application
is_production = var.is_production
namespace = var.namespace
environment_name = var.environment
infrastructure_support = var.infrastructure_support
rds_family = "postgres17"
db_instance_class = "db.t4g.micro"
db_engine = "postgres"
db_engine_version = "17.1"
prepare_for_major_upgrade = false
allow_major_version_upgrade = "true"
enable_rds_auto_start_stop = true

providers = {
aws = aws.london
}
}

resource "kubernetes_secret" "hmpps_person_match_rds" {
metadata {
name = "hmpps-person-match-rds-instance-output"
namespace = var.namespace
}

data = {
rds_instance_endpoint = module.hmpps_person_match_rds.rds_instance_endpoint
database_name = module.hmpps_person_match_rds.database_name
database_username = module.hmpps_person_match_rds.database_username
database_password = module.hmpps_person_match_rds.database_password
rds_instance_address = module.hmpps_person_match_rds.rds_instance_address
url = "postgres://${module.hmpps_person_match_rds.database_username}:${module.hmpps_person_match_rds.database_password}@${module.hmpps_person_match_rds.rds_instance_endpoint}/${module.hmpps_person_match_rds.database_name}"
}
}

0 comments on commit b57e62d

Please sign in to comment.