Skip to content

Commit f876811

Browse files
authored
Merge pull request #158 from NHSDigital/adding_prod_steps_to_deploy_gateway
DTOSS-13192: Configuration changes required to deploy Prod gateway in Hull
2 parents 809c8f6 + 767c164 commit f876811

11 files changed

Lines changed: 41 additions & 14 deletions

File tree

.gitleaksignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,3 +109,9 @@ feafe758d7c1e85472cc81c5c275aae9ec078cef:tests/services/dicom/test_upload_proces
109109
feafe758d7c1e85472cc81c5c275aae9ec078cef:tests/services/dicom/test_upload_processor.py:ipv4:131
110110
feafe758d7c1e85472cc81c5c275aae9ec078cef:tests/services/dicom/test_upload_processor.py:ipv4:150
111111
feafe758d7c1e85472cc81c5c275aae9ec078cef:tests/services/dicom/test_upload_processor.py:ipv4:174
112+
113+
# Ignore the SCREENING_ENTRA_GROUP_ID
114+
infrastructure/environments/prod/variables.tfvars:generic-api-key:2
115+
infrastructure/environments/preprod/variables.tfvars:generic-api-key:2
116+
infrastructure/environments/dev/variables.tfvars:generic-api-key:2
117+
infrastructure/environments/review/variables.tfvars:generic-api-key:2
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
enable_gateway_test_vm = true
1+
enable_gateway_test_vm = true
2+
screening_entra_group_id = "f20d9f9a-b1ac-4875-a5e1-f9dfc0307c34"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
# All values use defaults: enable_gateway_test_vm = false, enable_arc_servers = true
2+
screening_entra_group_id = "ab8fd001-2722-4118-9659-3d4425db7894"

infrastructure/environments/prod/variables.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,7 @@ HUB=prod
77
ENABLE_SOFT_DELETE=true
88
ADO_MANAGEMENT_POOL=private-pool-prod-uks
99
CLOUD_API_HOSTNAME=manage-breast-screening.nhs.uk
10+
SCREENING_ENTRA_GROUP_ID="3b2b22b0-ac8e-4904-a94b-9010ff08698a"
1011
# ring1 = first real sites (one per PACS vendor)
12+
# To onboard more rings: set GATEWAY_RINGS="ring0 ring1 ring2 ..." in this file
1113
GATEWAY_RINGS="ring1"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
# All values use defaults: enable_gateway_test_vm = false, enable_arc_servers = true
2+
SCREENING_ENTRA_GROUP_ID = "3b2b22b0-ac8e-4904-a94b-9010ff08698a"
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
enable_gateway_test_vm = true
1+
enable_gateway_test_vm = true
2+
screening_entra_group_id = "14f915c3-ef0a-471b-b9bf-31187d18f8b6"

infrastructure/modules/arc-infra/arc.tf

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@ data "azuread_service_principal" "arc_onboarding" {
1212
display_name = "spn-azure-arc-onboarding-screening-${var.env_config}"
1313
}
1414

15+
# Awaiting approval from Administrator team, a bit of push back with regards to giving Group.Read.All permission to the service principal, so for now we will use the group ID from the environment variable instead of looking it up by name.
1516
# Look up the Entra ID group that manages this environment
16-
data "azuread_group" "screening" {
17-
count = var.enable_arc_servers ? 1 : 0
18-
display_name = "screening_${var.app_short_name}_${var.env_config}"
19-
}
17+
# data "azuread_group" "screening" {
18+
# count = var.enable_arc_servers ? 1 : 0
19+
# display_name = "screening_${var.app_short_name}_${var.env_config}"
20+
# }
2021

2122
# Assign "Azure Connected Machine Onboarding" role to allow Arc server enrollment
2223
module "arc_onboarding_role" {
@@ -37,5 +38,8 @@ module "arc_wac_admin_login_role" {
3738

3839
scope = data.azurerm_resource_group.arc_enabled_servers[0].id
3940
role_definition_name = "Windows Admin Center Administrator Login"
40-
principal_id = data.azuread_group.screening[0].object_id
41+
# Awaiting approval from Administrator team, a bit of push back with regards to giving Group.Read.All permission to the service principal, so for now we will use the group ID from the environment variable instead of looking it up by name.
42+
# principal_id = data.azuread_group.screening[0].object_id
43+
principal_id = var.screening_entra_group_id
44+
4145
}

infrastructure/modules/arc-infra/variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,8 @@ variable "static_arc_machine_names" {
2828
type = list(string)
2929
default = []
3030
}
31+
32+
variable "screening_entra_group_id" {
33+
description = "Group ID for the environment"
34+
type = string
35+
}

infrastructure/modules/gateway-test-vm/vm.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ module "gateway_test_vm" {
3939

4040
account_credentials = {
4141
admin_credentials = {
42-
username = "arcadmin"
43-
password = data.azurerm_key_vault_secret.vm_admin_password.value
42+
username = "arcadmin"
43+
password = data.azurerm_key_vault_secret.vm_admin_password.value
4444
generate_admin_password_or_ssh_key = false
4545
}
4646
}

infrastructure/terraform/main.tf

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@ module "arc_infra" {
66
azuread = azuread
77
}
88

9-
region = local.region
10-
app_short_name = var.app_short_name
11-
env_config = var.env_config
12-
resource_group_name = local.resource_group_name
13-
enable_arc_servers = var.enable_arc_servers
9+
region = local.region
10+
app_short_name = var.app_short_name
11+
env_config = var.env_config
12+
resource_group_name = local.resource_group_name
13+
enable_arc_servers = var.enable_arc_servers
14+
screening_entra_group_id = var.screening_entra_group_id
1415

1516
# Create the HC for the test VM in the same run as VM creation.
1617
# The Arc data source won't see a machine registered in the same apply.

0 commit comments

Comments
 (0)