From 6ce294bcbbbbea532ca609bfdff7cd21d6090e62 Mon Sep 17 00:00:00 2001 From: Colin Saliceti Date: Tue, 5 Nov 2024 11:59:49 +0000 Subject: [PATCH] wip --- terraform/aks/.terraform.lock.hcl | 5 +++ terraform/aks/config/review.tfvars.json | 9 +---- terraform/aks/config/review_Terrafile | 2 +- terraform/aks/config/staging_Terrafile | 2 +- terraform/aks/data.tf | 6 --- terraform/aks/database.tf | 1 + terraform/aks/variables.tf | 51 ++----------------------- 7 files changed, 13 insertions(+), 63 deletions(-) diff --git a/terraform/aks/.terraform.lock.hcl b/terraform/aks/.terraform.lock.hcl index 6339337224..bcb458725b 100644 --- a/terraform/aks/.terraform.lock.hcl +++ b/terraform/aks/.terraform.lock.hcl @@ -6,6 +6,7 @@ provider "registry.terraform.io/eppo/environment" { constraints = "1.3.5" hashes = [ "h1:1Af95/IhzW16rbX8kSApfrAi8vwc5+7uVbCeyVaGw2E=", + "h1:J0rtl6GrLyBKYz6PQ5BXsyYfjHbgMEoAHEQQ3u0vPBc=", "h1:pceowuRAKcjLd+g4noIJdX6CBIWavlM4BvRTsGfH0uQ=", "zh:00e7a6bf7f0f09cc4871d7f4fee2c943ce61c05b9802365a97703d6c2e63e3dc", "zh:018d92e621177d053ed5c32e8220efa8c019852c4d60cc7539683bac28470d9b", @@ -31,6 +32,7 @@ provider "registry.terraform.io/hashicorp/azurerm" { hashes = [ "h1:2QbjtN4oMXzdA++Nvrj/wSmWZTPgXKOSFGGQCLEMrb4=", "h1:BCR3NIorFSvGG3v/+JOiiw3VM4PkChLO4m84wzD9NDo=", + "h1:SJM/KQDW9blKFmLMaupsZVYtcZ0fYpjLHEriMgCBGCY=", "zh:02b6606aff025fc2a962b3e568e000300abe959adac987183c24dac8eb057f4d", "zh:2a23a8ce24ff9e885925ffee0c3ea7eadba7a702541d05869275778aa47bdea7", "zh:57d10746384baeca4d5c56e88872727cdc150f437b8c5e14f0542127f7475e24", @@ -52,6 +54,7 @@ provider "registry.terraform.io/hashicorp/kubernetes" { hashes = [ "h1:3j4XBR5UWQA7xXaiEnzZp0bHbcwOhWetHYKTWIrUTI0=", "h1:Cj3RHyw3wE3AkNlCtSNrZfjFNkShvaZR0K/K3pJlYJU=", + "h1:HqeU0sZBh+2loFYqPMFx7jJamNUPEykyqJ9+CkMCYE0=", "zh:0e715d7fb13a8ad569a5fdc937b488590633f6942e986196fdb17cd7b8f7720e", "zh:495fc23acfe508ed981e60af9a3758218b0967993065e10a297fdbc210874974", "zh:4b930a8619910ef528bc90dae739cb4236b9b76ce41367281e3bc3cf586101c7", @@ -70,6 +73,7 @@ provider "registry.terraform.io/hashicorp/kubernetes" { provider "registry.terraform.io/hashicorp/random" { version = "3.6.3" hashes = [ + "h1:Fnaec9vA8sZ8BXVlN3Xn9Jz3zghSETIKg7ch8oXhxno=", "h1:f6jXn4MCv67kgcofx9D49qx1ZEBv8oyvwKDMPBr0A24=", "h1:zG9uFP8l9u+yGZZvi5Te7PV62j50azpgwPunq2vTm1E=", "zh:04ceb65210251339f07cd4611885d242cd4d0c7306e86dda9785396807c00451", @@ -91,6 +95,7 @@ provider "registry.terraform.io/statuscakedev/statuscake" { version = "2.2.2" constraints = "2.2.2" hashes = [ + "h1:OoqL/K/eNLahbfMwJvYZHo9kacafjtrJKhd6cLrubZ4=", "h1:nVaJkDBk4sv0yWFzg3p+yeJGzE8mB4KJv3Q6/UgU164=", "h1:wFoZJfmNvG6XTf65NLai67geSHqYV1Tilx7OITrHilE=", "zh:0916313344c579d6e05d70f88129a10fe48f7dabe0e61cad17874d6c496f288d", diff --git a/terraform/aks/config/review.tfvars.json b/terraform/aks/config/review.tfvars.json index fe1de67ec6..bc429df5f9 100644 --- a/terraform/aks/config/review.tfvars.json +++ b/terraform/aks/config/review.tfvars.json @@ -4,18 +4,13 @@ "azure_enable_backup_storage": false, "deploy_azure_backing_services": false, "enable_monitoring": false, - "key_vault_name": "s189t01-gse-rv-app-kv", "infra_key_vault_name": "s189t01-gse-rv-inf-kv", "key_vault_resource_group": "s189t01-gse-rv-rg", - "review_db_dbname": "review-db-name", - "review_db_hostname": "review-db-host", - "review_db_username": "review-db-username", - "review_db_password": "review-db-password", - "review_url_redis_name": "review-redis-url", "statuscake_password_name": "SC-PASSWORD", "sidekiq_replicas" : 1, "sidekiq_memory_max" : "1Gi", "create_dsi_ingress": true, "enable_logit": true, - "webapp_command": ["/app/docker-entrypoint.sh", "-e", "-f"] + "webapp_command": ["/app/docker-entrypoint.sh", "-e", "-f"], + "create_database": false } diff --git a/terraform/aks/config/review_Terrafile b/terraform/aks/config/review_Terrafile index 65af53b11d..f0281ed054 100644 --- a/terraform/aks/config/review_Terrafile +++ b/terraform/aks/config/review_Terrafile @@ -1,3 +1,3 @@ aks: source: "https://github.com/DFE-Digital/terraform-modules" - version: "main" + version: "2115-make-create-db-optional" diff --git a/terraform/aks/config/staging_Terrafile b/terraform/aks/config/staging_Terrafile index b4c222c13d..f0281ed054 100644 --- a/terraform/aks/config/staging_Terrafile +++ b/terraform/aks/config/staging_Terrafile @@ -1,3 +1,3 @@ aks: source: "https://github.com/DFE-Digital/terraform-modules" - version: "testing" + version: "2115-make-create-db-optional" diff --git a/terraform/aks/data.tf b/terraform/aks/data.tf index 7fd421ec4a..4fce56c8a0 100644 --- a/terraform/aks/data.tf +++ b/terraform/aks/data.tf @@ -1,9 +1,3 @@ -data "azurerm_key_vault" "app_secret_vault" { - count = 1 - name = var.key_vault_name - resource_group_name = var.key_vault_resource_group -} - data "azurerm_key_vault" "infra_secret_vault" { name = var.infra_key_vault_name resource_group_name = var.key_vault_resource_group diff --git a/terraform/aks/database.tf b/terraform/aks/database.tf index e341dcf398..396372a687 100644 --- a/terraform/aks/database.tf +++ b/terraform/aks/database.tf @@ -18,6 +18,7 @@ module "postgres" { azure_enable_high_availability = var.postgres_enable_high_availability azure_maintenance_window = var.azure_maintenance_window server_docker_image = "postgis/postgis:14-3.4" + create_database = var.create_database } module "redis-cache" { diff --git a/terraform/aks/variables.tf b/terraform/aks/variables.tf index 8ec65c4a5b..0adf494ac6 100644 --- a/terraform/aks/variables.tf +++ b/terraform/aks/variables.tf @@ -50,16 +50,6 @@ variable "app_replicas" { default = 1 } - - -variable "external_url" { - default = null - description = "Healthcheck URL for StatusCake monitoring" -} -variable "statuscake_contact_groups" { - default = [] - description = "ID of the contact group in statuscake web UI" -} variable "enable_monitoring" { default = false description = "Enable monitoring and alerting" @@ -68,10 +58,6 @@ variable "azure_enable_backup_storage" { default = true description = "Create storage account for database backup" } -variable "key_vault_name" { - default = null - description = "The name of the key vault to get postgres and redis" -} variable "infra_key_vault_name" { default = null @@ -91,27 +77,6 @@ variable "postgres_enable_high_availability" { default = false } -variable "review_db_dbname" { - default = null - description = "The name of the secret storing review db name" -} -variable "review_db_password" { - default = null - description = "The name of the secret storing review db password" -} - -variable "worker_apps" { - type = map( - object({ - startup_command = optional(list(string), []) - probe_command = optional(list(string), []) - replicas = optional(number, 1) - memory_max = optional(string, "1Gi") - }) - ) - default = {} -} - variable "statuscake_alerts" { type = map( object({ @@ -123,19 +88,6 @@ variable "statuscake_alerts" { default = {} } -variable "review_db_username" { - default = null - description = "The name of the secret storing review db username" -} -variable "review_db_hostname" { - default = null - description = "The name of the secret storing review db host" -} -variable "review_url_redis_name" { - default = null - description = "The name of the secret storing review redis url" -} - variable "statuscake_password_name" { default = "SC-PASSWORD" description = "The name of the statuscake password" @@ -157,6 +109,9 @@ variable "webapp_command" { default = ["/app/docker-entrypoint.sh", "-m", "-f"] description = "Start command to initialise and run the web app" } +variable "create_database" { + default = true +} locals { azure_credentials = try(jsondecode(var.azure_credentials_json), null)