diff --git a/Makefile b/Makefile index b1be4d439..7d7c91580 100644 --- a/Makefile +++ b/Makefile @@ -120,7 +120,7 @@ terraform-init: bin/terrafile set-azure-account -backend-config=storage_account_name=${AZURE_RESOURCE_PREFIX}${SERVICE_SHORT}tfstate${CONFIG_SHORT}sa \ -backend-config=key=${CONFIG}.tfstate - $(if $(IMAGE_TAG), , $(eval export IMAGE_TAG=sha-194cbc9)) + $(if $(IMAGE_TAG), , $(error The IMAGE_TAG variable must be provided)) $(eval export TF_VAR_paas_app_docker_image=ghcr.io/dfe-digital/get-into-teaching-api:$(IMAGE_TAG)) $(eval export TF_VAR_azure_resource_prefix=$(AZURE_RESOURCE_PREFIX)) $(eval export TF_VAR_config_short=$(CONFIG_SHORT)) diff --git a/terraform/aks/config/production_aks.tfvars.json b/terraform/aks/config/production_aks.tfvars.json index 60d7cf48b..4ce4a1f40 100644 --- a/terraform/aks/config/production_aks.tfvars.json +++ b/terraform/aks/config/production_aks.tfvars.json @@ -6,5 +6,9 @@ "cluster": "production", "namespace": "git-production", "enable_monitoring": false, - "enable_statuscake_alerts": true + "enable_statuscake_alerts": true, + "replicas": 2, + "redis_capacity": 1, + "redis_family": "P", + "redis_sku_name": "Premium" } diff --git a/terraform/aks/databases.tf b/terraform/aks/databases.tf index 8553f3dd1..f10cbd162 100644 --- a/terraform/aks/databases.tf +++ b/terraform/aks/databases.tf @@ -14,6 +14,10 @@ module "redis-cache" { azure_enable_monitoring = var.enable_monitoring azure_patch_schedule = [{ "day_of_week" : "Sunday", "start_hour_utc" : 01 }] azure_maxmemory_policy = "allkeys-lfu" + server_version = 6 + azure_capacity = var.redis_capacity + azure_family = var.redis_family + azure_sku_name = var.redis_sku_name } module "postgres" { diff --git a/terraform/aks/variables.tf b/terraform/aks/variables.tf index 4b96720dc..6cc119a03 100644 --- a/terraform/aks/variables.tf +++ b/terraform/aks/variables.tf @@ -43,6 +43,19 @@ variable "azure_enable_backup_storage" { default = true } variable "replicas" { default = 1 } variable "memory_max" { default = "1Gi" } +variable "redis_capacity" { + type = number + default = 1 +} +variable "redis_family" { + type = string + default = "C" +} +variable "redis_sku_name" { + type = string + default = "Standard" +} + locals { azure_credentials = try(jsondecode(var.azure_credentials), null) app_resource_group_name = "${var.azure_resource_prefix}-${var.service_short}-${var.config_short}-rg"