diff --git a/terraform/environments/delius-core/locals_development.tf b/terraform/environments/delius-core/locals_development.tf index ccba045c6f7..2c56348bf20 100644 --- a/terraform/environments/delius-core/locals_development.tf +++ b/terraform/environments/delius-core/locals_development.tf @@ -132,12 +132,12 @@ locals { container_cpu = 1024 } - user_management = { + umt = { image_tag = "5.7.6" container_port = 8080 container_memory = 4096 container_cpu = 1024 - elasticache_version = "6.0" + elasticache_version = "6.2" elasticache_node_type = "cache.t3.small" elasticache_port = 6379 elasticache_parameter_group_name = "default.redis6.x" diff --git a/terraform/environments/delius-core/locals_test.tf b/terraform/environments/delius-core/locals_test.tf index 017b3f8e946..fbb3c7b76ff 100644 --- a/terraform/environments/delius-core/locals_test.tf +++ b/terraform/environments/delius-core/locals_test.tf @@ -128,24 +128,17 @@ locals { container_cpu = 1024 } - user_management = { + umt = { image_tag = "5.7.6" container_port = 8080 container_memory = 4096 container_cpu = 1024 - elasticache_version = "6.0" + elasticache_version = "6.2" elasticache_node_type = "cache.t3.small" elasticache_port = 6379 elasticache_parameter_group_name = "default.redis6.x" } - user_management_config_test = { - image_tag = "5.7.6" - container_port = 8080 - container_memory = 4096 - container_cpu = 2048 - } - pwm = { image_tag = "8250538047-1" container_port = 8080 diff --git a/terraform/environments/delius-core/modules/delius_environment/user_management.tf b/terraform/environments/delius-core/modules/delius_environment/umt.tf similarity index 79% rename from terraform/environments/delius-core/modules/delius_environment/user_management.tf rename to terraform/environments/delius-core/modules/delius_environment/umt.tf index 7fdf7dc0d7c..bd5f9e39241 100644 --- a/terraform/environments/delius-core/modules/delius_environment/user_management.tf +++ b/terraform/environments/delius-core/modules/delius_environment/umt.tf @@ -1,4 +1,4 @@ -module "user_management" { +module "umt" { source = "../helpers/delius_microservice" account_config = var.account_config account_info = var.account_info @@ -6,24 +6,24 @@ module "user_management" { certificate_arn = aws_acm_certificate.external.arn container_vars_default = {} - container_vars_env_specific = try(var.delius_microservice_configs.user_management.container_vars_env_specific, {}) + container_vars_env_specific = try(var.delius_microservice_configs.umt.container_vars_env_specific, {}) container_secrets_default = {} - container_secrets_env_specific = try(var.delius_microservice_configs.user_management.container_secrets_env_specific, {}) + container_secrets_env_specific = try(var.delius_microservice_configs.umt.container_secrets_env_specific, {}) container_port_config = [ { - containerPort = var.delius_microservice_configs.user_management.container_port + containerPort = var.delius_microservice_configs.umt.container_port protocol = "tcp" } ] - name = "user-management" + name = "umt" env_name = var.env_name ecs_cluster_arn = module.ecs.ecs_cluster_arn - container_memory = var.delius_microservice_configs.user_management.container_memory - container_cpu = var.delius_microservice_configs.user_management.container_cpu + container_memory = var.delius_microservice_configs.umt.container_memory + container_cpu = var.delius_microservice_configs.umt.container_cpu health_check_path = "/umt" health_check_grace_period_seconds = 600 @@ -37,11 +37,12 @@ module "user_management" { create_elasticache = true elasticache_engine = "redis" - elasticache_engine_version = var.delius_microservice_configs.user_management.elasticache_version - elasticache_node_type = var.delius_microservice_configs.user_management.elasticache_node_type + elasticache_engine_version = var.delius_microservice_configs.umt.elasticache_version + elasticache_node_type = var.delius_microservice_configs.umt.elasticache_node_type elasticache_port = 6379 - elasticache_parameter_group_name = var.delius_microservice_configs.user_management.elasticache_parameter_group_name + elasticache_parameter_group_name = var.delius_microservice_configs.umt.elasticache_parameter_group_name elasticache_subnet_group_name = "nextcloud-elasticache-subnet-group" + elasticache_apply_immediately = true elasticache_parameters = { "notify-keyspace-events" = "eA" @@ -53,7 +54,7 @@ module "user_management" { microservice_lb_https_listener_arn = aws_lb_listener.listener_https.arn alb_listener_rule_paths = ["/umt"] - container_image = "${var.platform_vars.environment_management.account_ids["core-shared-services-production"]}.dkr.ecr.eu-west-2.amazonaws.com/delius-core-user-management-ecr-repo:${var.delius_microservice_configs.user_management.image_tag}" + container_image = "${var.platform_vars.environment_management.account_ids["core-shared-services-production"]}.dkr.ecr.eu-west-2.amazonaws.com/delius-core-user-management-ecr-repo:${var.delius_microservice_configs.umt.image_tag}" platform_vars = var.platform_vars tags = var.tags diff --git a/terraform/environments/delius-core/modules/helpers/delius_microservice/elasticache.tf b/terraform/environments/delius-core/modules/helpers/delius_microservice/elasticache.tf index c85733aa74a..1f8c983af38 100644 --- a/terraform/environments/delius-core/modules/helpers/delius_microservice/elasticache.tf +++ b/terraform/environments/delius-core/modules/helpers/delius_microservice/elasticache.tf @@ -16,6 +16,7 @@ resource "aws_elasticache_cluster" "this" { engine_version = var.elasticache_engine_version port = var.elasticache_port subnet_group_name = aws_elasticache_subnet_group.this[0].name + apply_immediately = var.elasticache_apply_immediately auto_minor_version_upgrade = true final_snapshot_identifier = var.elasticache_engine == "redis" ? "final-redis-${var.name}-${var.env_name}" : null maintenance_window = var.maintenance_window diff --git a/terraform/environments/delius-core/modules/helpers/delius_microservice/variables.tf b/terraform/environments/delius-core/modules/helpers/delius_microservice/variables.tf index 5d4f4f6d75d..9b6615b4d00 100644 --- a/terraform/environments/delius-core/modules/helpers/delius_microservice/variables.tf +++ b/terraform/environments/delius-core/modules/helpers/delius_microservice/variables.tf @@ -281,6 +281,12 @@ variable "elasticache_engine" { default = "redis" } +variable "elasticache_apply_immediately" { + description = "Apply changes immediately" + type = bool + default = false +} + variable "elasticache_endpoint_environment_variable" { description = "Environment variable to store the elasticache endpoint" type = string