You can use this terraform module to create a managed DevOps pool - it doesn't contain every option possible but just a subset of options that I needed for my deployments.
module "devops" {
source = "git::ssh://git@ssh.dev.azure.com/v3/myorg/tfmodules/tf_module_ado_managed_pool"
providers = {
azuredevops = azuredevops
}
resource_group_name = "my-resource-group"
location = "uscentral"
tags = var.tags
#Devcenter parameters
create_devcenter = true
devcenter_name = "devcenter"
#Project and pool parameters
project_name = "projectname"
pool_name = "poolname"
azure_devops_organization_name = "my-ado-org"
vnet_id = data.azurerm_virtual_network.vnet.id #id of the vnet to use
subnet_id = data.azurerm_subnet.subnet.id #is of the subnet
}
data "azurerm_virtual_network" "vnet" {
name = "vnet-name"
resource_group_name = "vnet-rg-name"
}
data "azurerm_subnet" "subnet" {
name = "subnet-name"
virtual_network_name = data.azurerm_virtual_network.vnet.name
resource_group_name = "vnet-rg-name"
}
The account / service principal running the terraform apply needs to have access to the Azure DevOps organisation as well as the ability to deploy resources to azure.