Skip to content

Commit a4bbeb1

Browse files
committed
wip
1 parent be90922 commit a4bbeb1

6 files changed

Lines changed: 98 additions & 59 deletions

File tree

docs/infrastructure/create-environment.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ This is the initial manual process to create a new environment like review, dev,
66

77
The environment requires a shared Azure front door profile created in the hub. The service name must be declared in [the hub configuration](https://github.com/NHSDigital/dtos-hub/tree/main/infrastructure/environments). And run the Azure devops pipeline for the corresponding hub (non-live or live).
88

9+
## Image Gallary
10+
11+
- create a new gallerie in the Azure compute galleries with name nonlive_lungcs_compute_gallery
12+
- create a resource group with name rg_hub_nonlive_lungcs_compute_gallery
13+
914
## Code
1015

1116
- Create the configuration files in `infrastructure/environments/[environment]`

infrastructure/bootstrap/hub.bicep

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ var privateDNSZoneRGName = 'rg-hub-${hubType}-${regionShortName}-private-dns-zon
4545
var keyVaultName = 'kv-${appShortName}-${hubType}-inf'
4646
var privateEndpointSubnetName = 'sn-hub-${hubType}-${regionShortName}-private-endpoint'
4747
var storageAccountName = 'sa${appShortName}${regionShortName}state'
48+
var computeGalleryName = '${appShortName}_hub_compute_gallery'
4849

4950
var miADOtoAZname = 'mi-${appShortName}-${hubType}-adotoaz-${regionShortName}'
5051
var miGHtoADOname = 'mi-${appShortName}-${hubType}-ghtoado-${regionShortName}'
@@ -248,3 +249,12 @@ module keyVaultPrivateDNSZone 'modules/dns.bicep' = {
248249
location: region
249250
}
250251
}
252+
253+
254+
module computeGallery 'modules/computeGallery.bicep' = {
255+
scope: resourceGroup(resourceGroupName)
256+
params: {
257+
galleryName: computeGalleryName
258+
location: region
259+
}
260+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
targetScope = 'resourceGroup'
2+
3+
@description('Name of the Azure Compute Gallery')
4+
param galleryName string
5+
6+
@description('Location for the gallery')
7+
param location string
8+
9+
resource computeGallery 'Microsoft.Compute/galleries@2023-07-03' = {
10+
name: galleryName
11+
location: location
12+
properties: {
13+
description: ''
14+
softDeletePolicy: {
15+
isSoftDeleteEnabled: false
16+
}
17+
}
18+
}

infrastructure/bootstrap/modules/managedDevopsPool.bicep

Lines changed: 54 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -48,57 +48,57 @@ resource devCenterProject 'Microsoft.DevCenter/projects@2025-02-01' = {
4848
}
4949
}
5050

51-
resource pool 'microsoft.devopsinfrastructure/pools@2025-09-20' = {
52-
name: poolName
53-
location: location
54-
properties: {
55-
organizationProfile: {
56-
organizations: [
57-
{
58-
url: 'https://dev.azure.com/${adoOrg}'
59-
parallelism: 1
60-
}
61-
]
62-
permissionProfile: {
63-
kind: 'CreatorOnly'
64-
}
65-
kind: 'AzureDevOps'
66-
}
67-
devCenterProjectResourceId: devCenterProject.id
68-
maximumConcurrency: poolSize
69-
agentProfile: {
70-
kind: 'Stateful' // or 'Stateless' - VM creation for each job, which tends to be too slow
71-
maxAgentLifetime: agentProfileMaxAgentLifetime // Only allowed if kind is Stateful
72-
// gracePeriodTimeSpan: '00:30:00' // Only allowed if kind is Stateful
73-
resourcePredictionsProfile: {
74-
kind: 'Automatic' // 'Manual' or 'Automatic'
75-
predictionPreference: 'Balanced'
76-
}
77-
}
78-
fabricProfile: {
79-
sku: {
80-
name: fabricProfileSkuName
81-
}
82-
images: [
83-
{
84-
aliases: [
85-
'ubuntu-22.04'
86-
'ubuntu-22.04/latest'
87-
]
88-
wellKnownImageName: 'ubuntu-22.04'
89-
}
90-
]
91-
osProfile: {
92-
logonType: 'Service' // or Interactive
93-
}
94-
storageProfile: {
95-
osDiskStorageAccountType: 'StandardSSD' // StandardSSD, Standard, or Premium
96-
}
97-
// Remove if you want to use 'Isolated Virtual Network'
98-
networkProfile: {
99-
subnetId: devopsSubnet.id
100-
}
101-
kind: 'Vmss'
102-
}
103-
}
104-
}
51+
// resource pool 'microsoft.devopsinfrastructure/pools@2025-09-20' = {
52+
// name: poolName
53+
// location: location
54+
// properties: {
55+
// organizationProfile: {
56+
// organizations: [
57+
// {
58+
// url: 'https://dev.azure.com/${adoOrg}'
59+
// parallelism: 1
60+
// }
61+
// ]
62+
// permissionProfile: {
63+
// kind: 'CreatorOnly'
64+
// }
65+
// kind: 'AzureDevOps'
66+
// }
67+
// devCenterProjectResourceId: devCenterProject.id
68+
// maximumConcurrency: poolSize
69+
// agentProfile: {
70+
// kind: 'Stateful' // or 'Stateless' - VM creation for each job, which tends to be too slow
71+
// maxAgentLifetime: agentProfileMaxAgentLifetime // Only allowed if kind is Stateful
72+
// // gracePeriodTimeSpan: '00:30:00' // Only allowed if kind is Stateful
73+
// resourcePredictionsProfile: {
74+
// kind: 'Automatic' // 'Manual' or 'Automatic'
75+
// predictionPreference: 'Balanced'
76+
// }
77+
// }
78+
// fabricProfile: {
79+
// sku: {
80+
// name: fabricProfileSkuName
81+
// }
82+
// images: [
83+
// {
84+
// aliases: [
85+
// 'ubuntu-22.04'
86+
// 'ubuntu-22.04/latest'
87+
// ]
88+
// wellKnownImageName: 'ubuntu-22.04'
89+
// }
90+
// ]
91+
// osProfile: {
92+
// logonType: 'Service' // or Interactive
93+
// }
94+
// storageProfile: {
95+
// osDiskStorageAccountType: 'StandardSSD' // StandardSSD, Standard, or Premium
96+
// }
97+
// // Remove if you want to use 'Isolated Virtual Network'
98+
// networkProfile: {
99+
// subnetId: devopsSubnet.id
100+
// }
101+
// kind: 'Vmss'
102+
// }
103+
// }
104+
// }

infrastructure/environments/nonlive-hub/variables.tfvars

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ avd_admins_group_name = "screening-lungcs-nonlive-virtual-desktop-admin-l
5252

5353
avd_source_image_from_gallery = {
5454
image_name = "gi_wvd"
55-
gallery_name = "rg_hub_dev_uks_compute_gallery"
56-
gallery_rg_name = "rg-hub-dev-uks-hub-virtual-desktop"
55+
gallery_name = "lungcs_hub_compute_gallery"
56+
gallery_rg_name = "rg-hub-nonlive-uks-bootstrap"
5757
}
5858

5959
law = {

infrastructure/terraform/hub/virtual_desktop.tf

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,15 @@ module "virtual-desktop-blue" {
6060
resource_group_name = azurerm_resource_group.avd-blue[each.key].name
6161
resource_group_id = azurerm_resource_group.avd-blue[each.key].id
6262
scaling_plan_name = module.config[each.key].names.avd-scaling-plan
63-
source_image_id = var.AVD_SOURCE_IMAGE_ID
64-
source_image_reference = var.avd_source_image_reference
65-
source_image_from_gallery = var.avd_source_image_from_gallery
63+
source_image_reference = {
64+
publisher = "MicrosoftWindowsDesktop"
65+
offer = "windows-11"
66+
sku = "win11-23h2-avd"
67+
version = "latest"
68+
}
69+
# source_image_id = var.AVD_SOURCE_IMAGE_ID
70+
# source_image_reference = var.avd_source_image_reference
71+
# source_image_from_gallery = var.avd_source_image_from_gallery
6672
subnet_id = module.subnets_hub["${module.config[each.key].names.subnet}-virtual-desktop"].id
6773
vm_count = local.blue_avd_primary || local.equal_vm_counts ? var.avd_vm_count : 1
6874
vm_name_prefix = module.config[each.key].names.avd-host

0 commit comments

Comments
 (0)