From 5e24efa75fe50ab4f90e6498c7fc6b7a2d9a378d Mon Sep 17 00:00:00 2001 From: Daniel Ciborowski Date: Tue, 26 Jul 2022 20:21:55 +0000 Subject: [PATCH 1/2] adding azure gaming: gdvmss --- modules/azure-gaming/game-dev-vmss/README.md | 22 + modules/azure-gaming/game-dev-vmss/main.bicep | 243 +++++++++ modules/azure-gaming/game-dev-vmss/main.json | 496 ++++++++++++++++++ .../azure-gaming/game-dev-vmss/metadata.json | 6 + .../nestedtemplates/virtualNetworks.bicep | 49 ++ .../game-dev-vmss/test/main.test.bicep | 8 + .../azure-gaming/game-dev-vmss/version.json | 8 + 7 files changed, 832 insertions(+) create mode 100644 modules/azure-gaming/game-dev-vmss/README.md create mode 100644 modules/azure-gaming/game-dev-vmss/main.bicep create mode 100644 modules/azure-gaming/game-dev-vmss/main.json create mode 100644 modules/azure-gaming/game-dev-vmss/metadata.json create mode 100644 modules/azure-gaming/game-dev-vmss/nestedtemplates/virtualNetworks.bicep create mode 100644 modules/azure-gaming/game-dev-vmss/test/main.test.bicep create mode 100644 modules/azure-gaming/game-dev-vmss/version.json diff --git a/modules/azure-gaming/game-dev-vmss/README.md b/modules/azure-gaming/game-dev-vmss/README.md new file mode 100644 index 0000000000..b964db22aa --- /dev/null +++ b/modules/azure-gaming/game-dev-vmss/README.md @@ -0,0 +1,22 @@ +# Azure Game Developer VMSS + +Azure Game Developer VMSS Bicep registry module + +## Parameters + +| Name | Type | Required | Description | +| :--------- | :------: | :------: | :-------------------------------- | +| `vmssName` | `string` | Yes | The name of someone to say hi to. | + +## Examples + +### Using the Azure Game Developer VMSS module + +```bicep +module gameDevVMSS 'br/public:azure-gaming/game-dev-vmss:1.0.0' = { + name: 'gameDevVMSS' + params: { + vmssName: 'vmssPool' + } +} +``` diff --git a/modules/azure-gaming/game-dev-vmss/main.bicep b/modules/azure-gaming/game-dev-vmss/main.bicep new file mode 100644 index 0000000000..ac372ee962 --- /dev/null +++ b/modules/azure-gaming/game-dev-vmss/main.bicep @@ -0,0 +1,243 @@ +@description('Deployment Location') +param location string = resourceGroup().location + +@description('Name of VMSS Cluster') +param vmssName string + +@description('GameDev Sku') +param vmssSku string = 'Standard_D4ds_v4' + +@description('GameDev Image Publisher') +@allowed([ + 'microsoftcorporation1602274591143' + 'azure-gaming' +]) +param vmssImgPublisher string = 'microsoftcorporation1602274591143' + +@description('GameDev Image Product Id') +@allowed([ + 'game-dev-vm' +]) +param vmssImgProduct string = 'game-dev-vm' + +@description('GameDev Image Sku') +@allowed([ + 'win10_no_engine_1_0' + 'ws2019_no_engine_1_0' + 'win10_unreal_4_27_2' + 'ws2019_unreal_4_27_2' + 'win10_unreal_5_0_1' + 'ws2019_unreal_5_0_1' +]) +param vmssImgSku string = 'win10_unreal_4_27_2' + +@description('GameDev Image Product Id') +param vmssImgVersion string = 'latest' + +@description('GameDev Disk Type') +param vmssOsDiskType string = 'Premium_LRS' + +@description('VMSS Instance Count') +@maxValue(100) +@minValue(1) +param vmssInstanceCount int = 1 + +@description('Administrator Login for access') +param administratorLogin string + +@description('Administrator Password for access') +@secure() +param passwordAdministratorLogin string + +@description('File Share Storage Account name') +param fileShareStorageAccount string = '' + +@description('File Share Storage Account key') +@secure() +param fileShareStorageAccountKey string = '' + +@description('File Share name') +param fileShareName string = '' + +@description('Perforce Port address') +param p4Port string = '' + +@description('Perforce User') +param p4Username string = '' + +@description('Perforce User password') +@secure() +param p4Password string = '' + +@description('Perforce Client Workspace') +param p4Workspace string = '' + +@description('Perforce Stream') +param p4Stream string = '' + +@description('Perforce Depot Client View mappings') +param p4ClientViews string = '' + +@description('Incredibuild License Key') +@secure() +param ibLicenseKey string = '' + +@description('GDK Version') +param gdkVersion string = 'June_2021_Update_4' + +@description('Use VM to sysprep an image from') +param useVmToSysprepCustomImage bool = false + +@description('Remote Access technology') +@allowed([ + 'RDP' + 'Teradici' + 'Parsec' +]) +param remoteAccessTechnology string = 'RDP' + +@description('Teradici Registration Key') +@secure() +param teradiciRegKey string = '' + +@description('Parsec Team ID') +param parsecTeamId string = '' + +@description('Parsec Team Key') +@secure() +param parsecTeamKey string = '' + +@description('Parsec Hostname') +param parsecHost string = '' + +@description('Parsec User Email') +param parsecUserEmail string = '' + +@description('Parsec Is Guest Access') +param parsecIsGuestAccess bool = false + +@description('Virtual Network Resource Name') +param vnetName string = 'vnet-${vmssName}' + +@description('Virtual Network Subnet Name') +param subnetName string = 'subnet${vmssName}' + +@description('Virtual Network Security Group Name') +param networkSecurityGroupName string = 'nsg-${vmssName}' + +@description('Virtual Network Address Prefix') +param vnetAddressPrefix string = '172.17.72.0/24' //Change as needed + +@description('Virtual Network Subnet Address Prefix') +param subnetAddressPrefix string = '172.17.72.0/25' // 172.17.72.[0-128] is part of this subnet + +var customData = format(''' +fileShareStorageAccount={0} +fileShareStorageAccountKey={1} +fileShareName={2} +p4Port={3} +p4Username={4} +p4Password={5} +p4Workspace={6} +p4Stream={7} +p4ClientViews={8} +ibLicenseKey={9} +gdkVersion={10} +useVmToSysprepCustomImage={11} +remoteAccessTechnology={12} +teradiciRegKey={13} +parsecTeamId={14} +parsecTeamKey={15} +parsecHost={16} +parsecUserEmail={17} +parsecIsGuestAccess={18} +deployedFromSolutionTemplate={19} +''', fileShareStorageAccount, fileShareStorageAccountKey, fileShareName, p4Port, p4Username, p4Password, p4Workspace, p4Stream, p4ClientViews, ibLicenseKey, gdkVersion, useVmToSysprepCustomImage, remoteAccessTechnology, teradiciRegKey, parsecTeamId, parsecTeamKey, parsecHost, parsecUserEmail, parsecIsGuestAccess, false) + + +module vnet './nestedtemplates/virtualNetworks.bicep' = { + name: vnetName + params: { + location: location + vnetName: vnetName + subnetName: subnetName + networkSecurityGroupName: networkSecurityGroupName + vnetAddressPrefix: vnetAddressPrefix + subnetAddressPrefix: subnetAddressPrefix + } +} + +resource vmss 'Microsoft.Compute/virtualMachineScaleSets@2021-04-01' = { + name: vmssName + location: location + sku: { + name: vmssSku + tier: 'Standard' + capacity: vmssInstanceCount + } + plan: { + name: vmssImgSku + publisher: vmssImgPublisher + product: vmssImgProduct + } + properties: { + singlePlacementGroup: false + upgradePolicy: { + mode: 'Manual' + } + virtualMachineProfile: { + storageProfile: { + osDisk: { + createOption: 'FromImage' + caching: 'ReadWrite' + managedDisk: { + storageAccountType: vmssOsDiskType + } + } + imageReference: { + publisher: vmssImgPublisher + offer: vmssImgProduct + sku: vmssImgSku + version: vmssImgVersion + } + } + networkProfile: { + networkInterfaceConfigurations: [ + { + name: '${vmssName}Nic' + properties: { + primary: true + ipConfigurations: [ + { + name: '${vmssName}IpConfig' + properties: { + subnet: { + id: vnet.outputs.subnetId + } + } + } + ] + networkSecurityGroup: { + id: vnet.outputs.nsgID + } + } + } + ] + } + osProfile: { + computerNamePrefix: vmssName + adminUsername: administratorLogin + adminPassword: passwordAdministratorLogin + customData: base64(customData) + windowsConfiguration: { + provisionVMAgent: true + } + } + priority: 'Regular' + } + overprovision: false + } +} + +output id string = vmss.id +output name string = vmss.name diff --git a/modules/azure-gaming/game-dev-vmss/main.json b/modules/azure-gaming/game-dev-vmss/main.json new file mode 100644 index 0000000000..d360a66674 --- /dev/null +++ b/modules/azure-gaming/game-dev-vmss/main.json @@ -0,0 +1,496 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "metadata": { + "_generator": { + "name": "bicep", + "version": "0.8.9.13224", + "templateHash": "2823250073952916021" + } + }, + "parameters": { + "location": { + "type": "string", + "defaultValue": "[resourceGroup().location]", + "metadata": { + "description": "Deployment Location" + } + }, + "vmssName": { + "type": "string", + "metadata": { + "description": "Name of VMSS Cluster" + } + }, + "vmssSku": { + "type": "string", + "defaultValue": "Standard_D4ds_v4", + "metadata": { + "description": "GameDev Sku" + } + }, + "vmssImgPublisher": { + "type": "string", + "defaultValue": "microsoftcorporation1602274591143", + "allowedValues": [ + "microsoftcorporation1602274591143", + "azure-gaming" + ], + "metadata": { + "description": "GameDev Image Publisher" + } + }, + "vmssImgProduct": { + "type": "string", + "defaultValue": "game-dev-vm", + "allowedValues": [ + "game-dev-vm" + ], + "metadata": { + "description": "GameDev Image Product Id" + } + }, + "vmssImgSku": { + "type": "string", + "defaultValue": "win10_unreal_4_27_2", + "allowedValues": [ + "win10_no_engine_1_0", + "ws2019_no_engine_1_0", + "win10_unreal_4_27_2", + "ws2019_unreal_4_27_2", + "win10_unreal_5_0_1", + "ws2019_unreal_5_0_1" + ], + "metadata": { + "description": "GameDev Image Sku" + } + }, + "vmssImgVersion": { + "type": "string", + "defaultValue": "latest", + "metadata": { + "description": "GameDev Image Product Id" + } + }, + "vmssOsDiskType": { + "type": "string", + "defaultValue": "Premium_LRS", + "metadata": { + "description": "GameDev Disk Type" + } + }, + "vmssInstanceCount": { + "type": "int", + "defaultValue": 1, + "minValue": 1, + "maxValue": 100, + "metadata": { + "description": "VMSS Instance Count" + } + }, + "administratorLogin": { + "type": "string", + "metadata": { + "description": "Administrator Login for access" + } + }, + "passwordAdministratorLogin": { + "type": "secureString", + "metadata": { + "description": "Administrator Password for access" + } + }, + "fileShareStorageAccount": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "File Share Storage Account name" + } + }, + "fileShareStorageAccountKey": { + "type": "secureString", + "defaultValue": "", + "metadata": { + "description": "File Share Storage Account key" + } + }, + "fileShareName": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "File Share name" + } + }, + "p4Port": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "Perforce Port address" + } + }, + "p4Username": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "Perforce User" + } + }, + "p4Password": { + "type": "secureString", + "defaultValue": "", + "metadata": { + "description": "Perforce User password" + } + }, + "p4Workspace": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "Perforce Client Workspace" + } + }, + "p4Stream": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "Perforce Stream" + } + }, + "p4ClientViews": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "Perforce Depot Client View mappings" + } + }, + "ibLicenseKey": { + "type": "secureString", + "defaultValue": "", + "metadata": { + "description": "Incredibuild License Key" + } + }, + "gdkVersion": { + "type": "string", + "defaultValue": "June_2021_Update_4", + "metadata": { + "description": "GDK Version" + } + }, + "useVmToSysprepCustomImage": { + "type": "bool", + "defaultValue": false, + "metadata": { + "description": "Use VM to sysprep an image from" + } + }, + "remoteAccessTechnology": { + "type": "string", + "defaultValue": "RDP", + "allowedValues": [ + "RDP", + "Teradici", + "Parsec" + ], + "metadata": { + "description": "Remote Access technology" + } + }, + "teradiciRegKey": { + "type": "secureString", + "defaultValue": "", + "metadata": { + "description": "Teradici Registration Key" + } + }, + "parsecTeamId": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "Parsec Team ID" + } + }, + "parsecTeamKey": { + "type": "secureString", + "defaultValue": "", + "metadata": { + "description": "Parsec Team Key" + } + }, + "parsecHost": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "Parsec Hostname" + } + }, + "parsecUserEmail": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "Parsec User Email" + } + }, + "parsecIsGuestAccess": { + "type": "bool", + "defaultValue": false, + "metadata": { + "description": "Parsec Is Guest Access" + } + }, + "vnetName": { + "type": "string", + "defaultValue": "[format('vnet-{0}', parameters('vmssName'))]", + "metadata": { + "description": "Virtual Network Resource Name" + } + }, + "subnetName": { + "type": "string", + "defaultValue": "[format('subnet{0}', parameters('vmssName'))]", + "metadata": { + "description": "Virtual Network Subnet Name" + } + }, + "networkSecurityGroupName": { + "type": "string", + "defaultValue": "[format('nsg-{0}', parameters('vmssName'))]", + "metadata": { + "description": "Virtual Network Security Group Name" + } + }, + "vnetAddressPrefix": { + "type": "string", + "defaultValue": "172.17.72.0/24", + "metadata": { + "description": "Virtual Network Address Prefix" + } + }, + "subnetAddressPrefix": { + "type": "string", + "defaultValue": "172.17.72.0/25", + "metadata": { + "description": "Virtual Network Subnet Address Prefix" + } + } + }, + "variables": { + "customData": "[format('fileShareStorageAccount={0}\r\nfileShareStorageAccountKey={1}\r\nfileShareName={2}\r\np4Port={3}\r\np4Username={4}\r\np4Password={5}\r\np4Workspace={6}\r\np4Stream={7}\r\np4ClientViews={8}\r\nibLicenseKey={9}\r\ngdkVersion={10}\r\nuseVmToSysprepCustomImage={11}\r\nremoteAccessTechnology={12}\r\nteradiciRegKey={13}\r\nparsecTeamId={14}\r\nparsecTeamKey={15}\r\nparsecHost={16}\r\nparsecUserEmail={17}\r\nparsecIsGuestAccess={18}\r\ndeployedFromSolutionTemplate={19}\r\n', parameters('fileShareStorageAccount'), parameters('fileShareStorageAccountKey'), parameters('fileShareName'), parameters('p4Port'), parameters('p4Username'), parameters('p4Password'), parameters('p4Workspace'), parameters('p4Stream'), parameters('p4ClientViews'), parameters('ibLicenseKey'), parameters('gdkVersion'), parameters('useVmToSysprepCustomImage'), parameters('remoteAccessTechnology'), parameters('teradiciRegKey'), parameters('parsecTeamId'), parameters('parsecTeamKey'), parameters('parsecHost'), parameters('parsecUserEmail'), parameters('parsecIsGuestAccess'), false())]" + }, + "resources": [ + { + "type": "Microsoft.Compute/virtualMachineScaleSets", + "apiVersion": "2021-04-01", + "name": "[parameters('vmssName')]", + "location": "[parameters('location')]", + "sku": { + "name": "[parameters('vmssSku')]", + "tier": "Standard", + "capacity": "[parameters('vmssInstanceCount')]" + }, + "plan": { + "name": "[parameters('vmssImgSku')]", + "publisher": "[parameters('vmssImgPublisher')]", + "product": "[parameters('vmssImgProduct')]" + }, + "properties": { + "singlePlacementGroup": false, + "upgradePolicy": { + "mode": "Manual" + }, + "virtualMachineProfile": { + "storageProfile": { + "osDisk": { + "createOption": "FromImage", + "caching": "ReadWrite", + "managedDisk": { + "storageAccountType": "[parameters('vmssOsDiskType')]" + } + }, + "imageReference": { + "publisher": "[parameters('vmssImgPublisher')]", + "offer": "[parameters('vmssImgProduct')]", + "sku": "[parameters('vmssImgSku')]", + "version": "[parameters('vmssImgVersion')]" + } + }, + "networkProfile": { + "networkInterfaceConfigurations": [ + { + "name": "[format('{0}Nic', parameters('vmssName'))]", + "properties": { + "primary": true, + "ipConfigurations": [ + { + "name": "[format('{0}IpConfig', parameters('vmssName'))]", + "properties": { + "subnet": { + "id": "[reference(resourceId('Microsoft.Resources/deployments', parameters('vnetName'))).outputs.subnetId.value]" + } + } + } + ], + "networkSecurityGroup": { + "id": "[reference(resourceId('Microsoft.Resources/deployments', parameters('vnetName'))).outputs.nsgID.value]" + } + } + } + ] + }, + "osProfile": { + "computerNamePrefix": "[parameters('vmssName')]", + "adminUsername": "[parameters('administratorLogin')]", + "adminPassword": "[parameters('passwordAdministratorLogin')]", + "customData": "[base64(variables('customData'))]", + "windowsConfiguration": { + "provisionVMAgent": true + } + }, + "priority": "Regular" + }, + "overprovision": false + }, + "dependsOn": [ + "[resourceId('Microsoft.Resources/deployments', parameters('vnetName'))]" + ] + }, + { + "type": "Microsoft.Resources/deployments", + "apiVersion": "2020-10-01", + "name": "[parameters('vnetName')]", + "properties": { + "expressionEvaluationOptions": { + "scope": "inner" + }, + "mode": "Incremental", + "parameters": { + "location": { + "value": "[parameters('location')]" + }, + "vnetName": { + "value": "[parameters('vnetName')]" + }, + "subnetName": { + "value": "[parameters('subnetName')]" + }, + "networkSecurityGroupName": { + "value": "[parameters('networkSecurityGroupName')]" + }, + "vnetAddressPrefix": { + "value": "[parameters('vnetAddressPrefix')]" + }, + "subnetAddressPrefix": { + "value": "[parameters('subnetAddressPrefix')]" + } + }, + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "metadata": { + "_generator": { + "name": "bicep", + "version": "0.8.9.13224", + "templateHash": "3327732133636508866" + } + }, + "parameters": { + "location": { + "type": "string" + }, + "vnetAddressPrefix": { + "type": "string" + }, + "subnetAddressPrefix": { + "type": "string" + }, + "vnetName": { + "type": "string" + }, + "subnetName": { + "type": "string" + }, + "networkSecurityGroupName": { + "type": "string" + } + }, + "resources": [ + { + "type": "Microsoft.Network/virtualNetworks", + "apiVersion": "2021-05-01", + "name": "[parameters('vnetName')]", + "location": "[parameters('location')]", + "properties": { + "addressSpace": { + "addressPrefixes": [ + "[parameters('vnetAddressPrefix')]" + ] + }, + "enableDdosProtection": false + } + }, + { + "type": "Microsoft.Network/networkSecurityGroups", + "apiVersion": "2021-08-01", + "name": "[parameters('networkSecurityGroupName')]", + "location": "[parameters('location')]" + }, + { + "type": "Microsoft.Network/virtualNetworks/subnets", + "apiVersion": "2021-05-01", + "name": "[format('{0}/{1}', parameters('vnetName'), parameters('subnetName'))]", + "properties": { + "addressPrefix": "[parameters('subnetAddressPrefix')]", + "privateEndpointNetworkPolicies": "Disabled", + "privateLinkServiceNetworkPolicies": "Enabled", + "networkSecurityGroup": { + "id": "[resourceId('Microsoft.Network/networkSecurityGroups', parameters('networkSecurityGroupName'))]" + }, + "serviceEndpoints": [ + { + "service": "Microsoft.Storage" + } + ] + }, + "dependsOn": [ + "[resourceId('Microsoft.Network/networkSecurityGroups', parameters('networkSecurityGroupName'))]", + "[resourceId('Microsoft.Network/virtualNetworks', parameters('vnetName'))]" + ] + } + ], + "outputs": { + "subnetId": { + "type": "string", + "value": "[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('vnetName'), parameters('subnetName'))]" + }, + "vnetId": { + "type": "string", + "value": "[resourceId('Microsoft.Network/virtualNetworks', parameters('vnetName'))]" + }, + "vnet": { + "type": "string", + "value": "[parameters('vnetName')]" + }, + "subnet": { + "type": "object", + "value": "[reference(resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('vnetName'), parameters('subnetName')), '2021-05-01', 'full')]" + }, + "nsgID": { + "type": "string", + "value": "[resourceId('Microsoft.Network/networkSecurityGroups', parameters('networkSecurityGroupName'))]" + } + } + } + } + } + ], + "outputs": { + "id": { + "type": "string", + "value": "[resourceId('Microsoft.Compute/virtualMachineScaleSets', parameters('vmssName'))]" + }, + "name": { + "type": "string", + "value": "[parameters('vmssName')]" + } + } +} \ No newline at end of file diff --git a/modules/azure-gaming/game-dev-vmss/metadata.json b/modules/azure-gaming/game-dev-vmss/metadata.json new file mode 100644 index 0000000000..2d0eb9377d --- /dev/null +++ b/modules/azure-gaming/game-dev-vmss/metadata.json @@ -0,0 +1,6 @@ +{ + "$schema": "https://aka.ms/bicep-registry-module-metadata-file-schema#", + "name": "Azure Game Developer VMSS", + "description": "Bicep module to smiplfiy deployment of the Azure Game Developer VMSS", + "owner": "dciborow" +} diff --git a/modules/azure-gaming/game-dev-vmss/nestedtemplates/virtualNetworks.bicep b/modules/azure-gaming/game-dev-vmss/nestedtemplates/virtualNetworks.bicep new file mode 100644 index 0000000000..a825a4a9df --- /dev/null +++ b/modules/azure-gaming/game-dev-vmss/nestedtemplates/virtualNetworks.bicep @@ -0,0 +1,49 @@ +param location string +param vnetAddressPrefix string +param subnetAddressPrefix string +param vnetName string +param subnetName string +param networkSecurityGroupName string + +resource vnet 'Microsoft.Network/virtualNetworks@2021-05-01' = { + name: vnetName + location: location + properties: { + addressSpace: { + addressPrefixes: [ + vnetAddressPrefix + ] + } + enableDdosProtection: false + } +} + +//By Default the nsg will allow the vnet access and deny all other access +resource networkSecurityGroup 'Microsoft.Network/networkSecurityGroups@2021-08-01' = { + name: networkSecurityGroupName + location: location +} + +resource subnet 'Microsoft.Network/virtualNetworks/subnets@2021-05-01' = { + parent: vnet + name: subnetName + properties: { + addressPrefix: subnetAddressPrefix + privateEndpointNetworkPolicies: 'Disabled' + privateLinkServiceNetworkPolicies: 'Enabled' + networkSecurityGroup: { + id: networkSecurityGroup.id + } + serviceEndpoints: [ + { + service: 'Microsoft.Storage' + } + ] + } +} + +output subnetId string = subnet.id +output vnetId string = vnet.id +output vnet string = vnet.name +output subnet object = subnet +output nsgID string = networkSecurityGroup.id diff --git a/modules/azure-gaming/game-dev-vmss/test/main.test.bicep b/modules/azure-gaming/game-dev-vmss/test/main.test.bicep new file mode 100644 index 0000000000..ccca9fa5dc --- /dev/null +++ b/modules/azure-gaming/game-dev-vmss/test/main.test.bicep @@ -0,0 +1,8 @@ +module testMain '../main.bicep' = { + name: 'testMain' + params: { + vmssName: 'GEN-UNIQUE-7' + administratorLogin: 'GEN-UNIQUE' + passwordAdministratorLogin: 'GEN-PASSWORD' + } +} diff --git a/modules/azure-gaming/game-dev-vmss/version.json b/modules/azure-gaming/game-dev-vmss/version.json new file mode 100644 index 0000000000..e40897e287 --- /dev/null +++ b/modules/azure-gaming/game-dev-vmss/version.json @@ -0,0 +1,8 @@ +{ + "$schema": "https://aka.ms/bicep-registry-module-version-file-schema#", + "version": "1.0", + "pathFilters": [ + "./main.json", + "./metadata.json" + ] +} \ No newline at end of file From e93e40f7e40b6c584f8912fde412aae7a8aadc9a Mon Sep 17 00:00:00 2001 From: Daniel Ciborowski Date: Tue, 26 Jul 2022 20:37:17 +0000 Subject: [PATCH 2/2] static analysis cleanup --- modules/azure-gaming/game-dev-vmss/README.md | 57 +++++++++++++++++-- modules/azure-gaming/game-dev-vmss/main.bicep | 3 + modules/azure-gaming/game-dev-vmss/main.json | 14 +++-- .../azure-gaming/game-dev-vmss/metadata.json | 8 +-- .../game-dev-vmss/test/main.test.bicep | 4 ++ 5 files changed, 72 insertions(+), 14 deletions(-) diff --git a/modules/azure-gaming/game-dev-vmss/README.md b/modules/azure-gaming/game-dev-vmss/README.md index b964db22aa..5e59217fd8 100644 --- a/modules/azure-gaming/game-dev-vmss/README.md +++ b/modules/azure-gaming/game-dev-vmss/README.md @@ -1,12 +1,57 @@ -# Azure Game Developer VMSS +# Azure GameDev VMSS -Azure Game Developer VMSS Bicep registry module +Bicep Module to simplify deployment of the Azure Game Developer VMSS + +## Description + +{{ Add detailed description for the module. }} ## Parameters -| Name | Type | Required | Description | -| :--------- | :------: | :------: | :-------------------------------- | -| `vmssName` | `string` | Yes | The name of someone to say hi to. | +| Name | Type | Required | Description | +| :--------------------------- | :------------: | :------: | :------------------------------------ | +| `location` | `string` | No | Deployment Location | +| `vmssName` | `string` | Yes | Name of VMSS Cluster | +| `vmssSku` | `string` | No | GameDev Sku | +| `vmssImgPublisher` | `string` | No | GameDev Image Publisher | +| `vmssImgProduct` | `string` | No | GameDev Image Product Id | +| `vmssImgSku` | `string` | No | GameDev Image Sku | +| `vmssImgVersion` | `string` | No | GameDev Image Product Id | +| `vmssOsDiskType` | `string` | No | GameDev Disk Type | +| `vmssInstanceCount` | `int` | No | VMSS Instance Count | +| `administratorLogin` | `string` | Yes | Administrator Login for access | +| `passwordAdministratorLogin` | `secureString` | Yes | Administrator Password for access | +| `fileShareStorageAccount` | `string` | No | File Share Storage Account name | +| `fileShareStorageAccountKey` | `secureString` | No | File Share Storage Account key | +| `fileShareName` | `string` | No | File Share name | +| `p4Port` | `string` | No | Perforce Port address | +| `p4Username` | `string` | No | Perforce User | +| `p4Password` | `secureString` | No | Perforce User password | +| `p4Workspace` | `string` | No | Perforce Client Workspace | +| `p4Stream` | `string` | No | Perforce Stream | +| `p4ClientViews` | `string` | No | Perforce Depot Client View mappings | +| `ibLicenseKey` | `secureString` | No | Incredibuild License Key | +| `gdkVersion` | `string` | No | GDK Version | +| `useVmToSysprepCustomImage` | `bool` | No | Use VM to sysprep an image from | +| `remoteAccessTechnology` | `string` | No | Remote Access technology | +| `teradiciRegKey` | `secureString` | No | Teradici Registration Key | +| `parsecTeamId` | `string` | No | Parsec Team ID | +| `parsecTeamKey` | `secureString` | No | Parsec Team Key | +| `parsecHost` | `string` | No | Parsec Hostname | +| `parsecUserEmail` | `string` | No | Parsec User Email | +| `parsecIsGuestAccess` | `bool` | No | Parsec Is Guest Access | +| `vnetName` | `string` | No | Virtual Network Resource Name | +| `subnetName` | `string` | No | Virtual Network Subnet Name | +| `networkSecurityGroupName` | `string` | No | Virtual Network Security Group Name | +| `vnetAddressPrefix` | `string` | No | Virtual Network Address Prefix | +| `subnetAddressPrefix` | `string` | No | Virtual Network Subnet Address Prefix | + +## Outputs + +| Name | Type | Description | +| :--- | :----: | :---------- | +| id | string | VMSS ID | +| name | string | VMSS Name | ## Examples @@ -19,4 +64,4 @@ module gameDevVMSS 'br/public:azure-gaming/game-dev-vmss:1.0.0' = { vmssName: 'vmssPool' } } -``` +``` \ No newline at end of file diff --git a/modules/azure-gaming/game-dev-vmss/main.bicep b/modules/azure-gaming/game-dev-vmss/main.bicep index ac372ee962..8a92b67133 100644 --- a/modules/azure-gaming/game-dev-vmss/main.bicep +++ b/modules/azure-gaming/game-dev-vmss/main.bicep @@ -239,5 +239,8 @@ resource vmss 'Microsoft.Compute/virtualMachineScaleSets@2021-04-01' = { } } +@description('VMSS ID') output id string = vmss.id + +@description('VMSS Name') output name string = vmss.name diff --git a/modules/azure-gaming/game-dev-vmss/main.json b/modules/azure-gaming/game-dev-vmss/main.json index d360a66674..ef6dcd302d 100644 --- a/modules/azure-gaming/game-dev-vmss/main.json +++ b/modules/azure-gaming/game-dev-vmss/main.json @@ -5,7 +5,7 @@ "_generator": { "name": "bicep", "version": "0.8.9.13224", - "templateHash": "2823250073952916021" + "templateHash": "14157587555883255881" } }, "parameters": { @@ -275,7 +275,7 @@ } }, "variables": { - "customData": "[format('fileShareStorageAccount={0}\r\nfileShareStorageAccountKey={1}\r\nfileShareName={2}\r\np4Port={3}\r\np4Username={4}\r\np4Password={5}\r\np4Workspace={6}\r\np4Stream={7}\r\np4ClientViews={8}\r\nibLicenseKey={9}\r\ngdkVersion={10}\r\nuseVmToSysprepCustomImage={11}\r\nremoteAccessTechnology={12}\r\nteradiciRegKey={13}\r\nparsecTeamId={14}\r\nparsecTeamKey={15}\r\nparsecHost={16}\r\nparsecUserEmail={17}\r\nparsecIsGuestAccess={18}\r\ndeployedFromSolutionTemplate={19}\r\n', parameters('fileShareStorageAccount'), parameters('fileShareStorageAccountKey'), parameters('fileShareName'), parameters('p4Port'), parameters('p4Username'), parameters('p4Password'), parameters('p4Workspace'), parameters('p4Stream'), parameters('p4ClientViews'), parameters('ibLicenseKey'), parameters('gdkVersion'), parameters('useVmToSysprepCustomImage'), parameters('remoteAccessTechnology'), parameters('teradiciRegKey'), parameters('parsecTeamId'), parameters('parsecTeamKey'), parameters('parsecHost'), parameters('parsecUserEmail'), parameters('parsecIsGuestAccess'), false())]" + "customData": "[format('fileShareStorageAccount={0}\nfileShareStorageAccountKey={1}\nfileShareName={2}\np4Port={3}\np4Username={4}\np4Password={5}\np4Workspace={6}\np4Stream={7}\np4ClientViews={8}\nibLicenseKey={9}\ngdkVersion={10}\nuseVmToSysprepCustomImage={11}\nremoteAccessTechnology={12}\nteradiciRegKey={13}\nparsecTeamId={14}\nparsecTeamKey={15}\nparsecHost={16}\nparsecUserEmail={17}\nparsecIsGuestAccess={18}\ndeployedFromSolutionTemplate={19}\n', parameters('fileShareStorageAccount'), parameters('fileShareStorageAccountKey'), parameters('fileShareName'), parameters('p4Port'), parameters('p4Username'), parameters('p4Password'), parameters('p4Workspace'), parameters('p4Stream'), parameters('p4ClientViews'), parameters('ibLicenseKey'), parameters('gdkVersion'), parameters('useVmToSysprepCustomImage'), parameters('remoteAccessTechnology'), parameters('teradiciRegKey'), parameters('parsecTeamId'), parameters('parsecTeamKey'), parameters('parsecHost'), parameters('parsecUserEmail'), parameters('parsecIsGuestAccess'), false())]" }, "resources": [ { @@ -486,11 +486,17 @@ "outputs": { "id": { "type": "string", - "value": "[resourceId('Microsoft.Compute/virtualMachineScaleSets', parameters('vmssName'))]" + "value": "[resourceId('Microsoft.Compute/virtualMachineScaleSets', parameters('vmssName'))]", + "metadata": { + "description": "VMSS ID" + } }, "name": { "type": "string", - "value": "[parameters('vmssName')]" + "value": "[parameters('vmssName')]", + "metadata": { + "description": "VMSS Name" + } } } } \ No newline at end of file diff --git a/modules/azure-gaming/game-dev-vmss/metadata.json b/modules/azure-gaming/game-dev-vmss/metadata.json index 2d0eb9377d..8cf954fc41 100644 --- a/modules/azure-gaming/game-dev-vmss/metadata.json +++ b/modules/azure-gaming/game-dev-vmss/metadata.json @@ -1,6 +1,6 @@ { - "$schema": "https://aka.ms/bicep-registry-module-metadata-file-schema#", - "name": "Azure Game Developer VMSS", - "description": "Bicep module to smiplfiy deployment of the Azure Game Developer VMSS", + "$schema": "https://aka.ms/bicep-registry-module-metadata-file-schema-v2#", + "name": "Azure GameDev VMSS", + "summary": "Bicep Module to simplify deployment of the Azure Game Developer VMSS", "owner": "dciborow" -} +} \ No newline at end of file diff --git a/modules/azure-gaming/game-dev-vmss/test/main.test.bicep b/modules/azure-gaming/game-dev-vmss/test/main.test.bicep index ccca9fa5dc..0bd439f630 100644 --- a/modules/azure-gaming/game-dev-vmss/test/main.test.bicep +++ b/modules/azure-gaming/game-dev-vmss/test/main.test.bicep @@ -1,6 +1,10 @@ +@description('Deployment Location') +param location string = resourceGroup().location + module testMain '../main.bicep' = { name: 'testMain' params: { + location: location vmssName: 'GEN-UNIQUE-7' administratorLogin: 'GEN-UNIQUE' passwordAdministratorLogin: 'GEN-PASSWORD'