Skip to content

Commit 9c4a77c

Browse files
Merge pull request #830 from NHSDigital/DTOSS-11851-improve-app-resilience
[DTOSS-11851] - Set minimum replicas to 2 for preprod and prod environments
2 parents 7a99d06 + 66042f8 commit 9c4a77c

File tree

6 files changed

+18
-3
lines changed

6 files changed

+18
-3
lines changed

infrastructure/environments/preprod/variables.tfvars

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ seed_demo_data = false
1313
allowed_paths = ["/notifications/message-status/create"]
1414
enable_alerting = true
1515
enable_notifications_jobs_schedule = true
16+
min_replicas = 2

infrastructure/environments/prod/variables.tfvars

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ enable_alerting = true
1414
use_apex_domain = true
1515
cae_zone_redundancy_enabled = true
1616
enable_notifications_jobs_schedule = true
17+
min_replicas = 2

infrastructure/modules/container-apps/main.tf

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,10 @@ module "webapp" {
4646
{ APPLICATIONINSIGHTS_CONNECTION_STRING = var.app_insights_connection_string },
4747
var.deploy_database_as_container ? { DATABASE_PASSWORD = resource.random_password.admin_password[0].result } : {}
4848
)
49-
is_web_app = true
50-
port = 8000
51-
probe_path = "/healthcheck"
49+
is_web_app = true
50+
port = 8000
51+
probe_path = "/healthcheck"
52+
min_replicas = var.min_replicas
5253

5354
}
5455

infrastructure/modules/container-apps/variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ variable "container_app_environment_id" {
2929
type = string
3030
}
3131

32+
variable "min_replicas" {
33+
description = "Minimum number of container replicas"
34+
type = number
35+
}
36+
3237
variable "default_domain" {
3338
description = "The container app environment default domain"
3439
type = string

infrastructure/terraform/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,5 @@ module "container-apps" {
8181
resource_group_name_infra = local.resource_group_name
8282
enable_notifications_jobs_schedule = var.enable_notifications_jobs_schedule
8383
queue_length_alert_threshold = var.queue_length_alert_threshold
84+
min_replicas = var.min_replicas
8485
}

infrastructure/terraform/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ variable "deploy_container_apps" {
1616
default = true
1717
}
1818

19+
variable "min_replicas" {
20+
description = "Minimum number of container replicas"
21+
type = number
22+
default = 1
23+
}
24+
1925
variable "app_short_name" {
2026
description = "Application short name (6 characters)"
2127
type = string

0 commit comments

Comments
 (0)