Skip to content

Commit dcd40c8

Browse files
authored
fix: DTOSS-9699 Add workload_profile to container apps (#1174)
* Add workload_profile to container apps * Update template refs * Add CAE subnet delegation * Consolidate changes across environments
1 parent 70a3d80 commit dcd40c8

File tree

8 files changed

+27
-14
lines changed

8 files changed

+27
-14
lines changed

.azuredevops/pipelines/cd-infrastructure-dev-core.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ resources:
1313
- repository: dtos-devops-templates
1414
type: github
1515
name: NHSDigital/dtos-devops-templates
16-
ref: 2041f050215b170eef2853e78e010c2a949a9bae
16+
ref: e4e68ea29c4fab7014caf900063fe70f785732f3
1717
endpoint: NHSDigital
1818

1919
variables:

.azuredevops/pipelines/cd-infrastructure-int-core.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ resources:
1313
- repository: dtos-devops-templates
1414
type: github
1515
name: NHSDigital/dtos-devops-templates
16-
ref: 2041f050215b170eef2853e78e010c2a949a9bae
16+
ref: e4e68ea29c4fab7014caf900063fe70f785732f3
1717
endpoint: NHSDigital
1818

1919
variables:

.azuredevops/pipelines/cd-infrastructure-nft-core.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ resources:
1313
- repository: dtos-devops-templates
1414
type: github
1515
name: NHSDigital/dtos-devops-templates
16-
ref: 2041f050215b170eef2853e78e010c2a949a9bae
16+
ref: e4e68ea29c4fab7014caf900063fe70f785732f3
1717
endpoint: NHSDigital
1818

1919
variables:

infrastructure/tf-core/container_app_environment.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ module "container-app-environment" {
1414

1515
log_analytics_workspace_id = data.terraform_remote_state.audit.outputs.log_analytics_workspace_id[local.primary_region]
1616
vnet_integration_subnet_id = module.subnets["${module.regions_config[each.value.region].names.subnet}-container-app-${lower(each.value.container_app_environment)}"].id
17+
workload_profile = each.value.workload_profile
1718
zone_redundancy_enabled = each.value.zone_redundancy_enabled
1819
}
1920

infrastructure/tf-core/environments/development.tfvars

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ regions = {
5151
container-app-db-management = {
5252
cidr_newbits = 7
5353
cidr_offset = 6
54+
delegation_name = "Microsoft.App/environments"
55+
service_delegation_name = "Microsoft.App/environments"
56+
service_delegation_actions = ["Microsoft.Network/virtualNetworks/subnets/action"]
5457
}
5558
}
5659
}

infrastructure/tf-core/environments/integration.tfvars

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ features = {
1111
public_network_access_enabled = false
1212
}
1313

14+
# these will be merged with compliance tags in locals.tf
1415
tags = {
1516
Environment = "integration"
1617
}
@@ -50,6 +51,9 @@ regions = {
5051
container-app-db-management = {
5152
cidr_newbits = 7
5253
cidr_offset = 6
54+
delegation_name = "Microsoft.App/environments"
55+
service_delegation_name = "Microsoft.App/environments"
56+
service_delegation_actions = ["Microsoft.Network/virtualNetworks/subnets/action"]
5357
}
5458
}
5559
}
@@ -1097,6 +1101,7 @@ function_apps = {
10971101
AcceptableLatencyThresholdMs = "500"
10981102
}
10991103
}
1104+
11001105
ReferenceDataService = {
11011106
name_suffix = "reference-data-service"
11021107
function_endpoint_name = "ReferenceDataService"

infrastructure/tf-core/environments/nft.tfvars

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ features = {
1111
public_network_access_enabled = false
1212
}
1313

14+
# these will be merged with compliance tags in locals.tf
1415
tags = {
1516
Environment = "non-functional testing"
1617
}
@@ -47,9 +48,12 @@ regions = {
4748
cidr_newbits = 8
4849
cidr_offset = 5
4950
}
50-
container-app-db-management-4 = {
51+
container-app-db-management = {
5152
cidr_newbits = 7
5253
cidr_offset = 6
54+
delegation_name = "Microsoft.App/environments"
55+
service_delegation_name = "Microsoft.App/environments"
56+
service_delegation_actions = ["Microsoft.Network/virtualNetworks/subnets/action"]
5357
}
5458
}
5559
}
@@ -144,13 +148,6 @@ app_service_plan = {
144148
capacity_min = "1"
145149
capacity_max = "4"
146150
capacity_def = "2"
147-
148-
inc_threshold = 5
149-
dec_threshold = 5
150-
inc_scale_value = 2
151-
152-
dec_scale_type = "ChangeCount"
153-
dec_scale_value = 1
154151
}
155152
}
156153
}
@@ -195,16 +192,16 @@ app_service_plan = {
195192

196193
container_app_environments = {
197194
instances = {
198-
db-management-4 = {
195+
db-management = {
199196
zone_redundancy_enabled = false
200197
}
201198
}
202199
}
203200

204201
container_app_jobs = {
205202
apps = {
206-
db-management-4 = {
207-
container_app_environment_key = "db-management-4"
203+
db-management = {
204+
container_app_environment_key = "db-management"
208205
docker_env_tag = "nft"
209206
docker_image = "cohort-manager-db-migration"
210207
container_registry_use_mi = true
@@ -1100,6 +1097,7 @@ function_apps = {
11001097
AcceptableLatencyThresholdMs = "500"
11011098
}
11021099
}
1100+
11031101
ReferenceDataService = {
11041102
name_suffix = "reference-data-service"
11051103
function_endpoint_name = "ReferenceDataService"

infrastructure/tf-core/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,12 @@ variable "container_app_environments" {
161161
default = {}
162162
type = object({
163163
instances = optional(map(object({
164+
workload_profile = optional(object({
165+
name = optional(string)
166+
workload_profile_type = optional(string)
167+
minimum_count = optional(number, 0)
168+
maximum_count = optional(string, 1)
169+
}), {})
164170
zone_redundancy_enabled = optional(bool, false)
165171
})), {})
166172
})

0 commit comments

Comments
 (0)