Skip to content

Commit

Permalink
♻️ Rename module to umt + upgrade redis to 6.2 (#6093)
Browse files Browse the repository at this point in the history
* ♻️ Renamed to umt + upgrade redis to 6.2

* Update umt.tf

* typo

* apply immediately
  • Loading branch information
georgepstaylor authored May 15, 2024
1 parent efd4232 commit b5ae102
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 22 deletions.
4 changes: 2 additions & 2 deletions terraform/environments/delius-core/locals_development.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
11 changes: 2 additions & 9 deletions terraform/environments/delius-core/locals_test.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
module "user_management" {
module "umt" {
source = "../helpers/delius_microservice"
account_config = var.account_config
account_info = var.account_info
alb_security_group_id = aws_security_group.delius_frontend_alb_security_group.id
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
Expand All @@ -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"
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b5ae102

Please sign in to comment.