Skip to content

Terraform module to create a private build agent for Azure DevOps using a Virtual Machine Scale Set

License

Notifications You must be signed in to change notification settings

Ensono/terraform-azurerm-ado-build-agent

Repository files navigation

Terraform ADO Build Agent

This module creates a private Azure DevOps Build agent running on a virtual machine scaleset (VMSS) which can be used when building and deploying a data project.

To use the module reference the GitHub repo in the Terraform file, for example:

module "kv_default" {
    source = "github.com/ensono/terraform-azurerm-ado-build-agent"
    ...
}

Requirements

No requirements.

Providers

Name Version
azurerm n/a
random n/a
template n/a

Modules

No modules.

Resources

Name Type
azurerm_linux_virtual_machine_scale_set.vmss resource
azurerm_virtual_machine_scale_set_extension.setup resource
random_password.admin_password resource
azurerm_subnet.subnet data source
template_file.setup_build_agent data source

Inputs

Name Description Type Default Required
ado_agent_pool Name of the Azure DevOps Agent Pool to which this agent belongs string n/a yes
ado_agent_version Version of the Azure DevOps Agent string "4.248.0" no
ado_org_url URL of the Azure DevOps Organization string n/a yes
ado_pat Personal Access Token for the Azure DevOps Organization string n/a yes
ado_project_id ID of the Azure DevOps Project string n/a yes
debug_enabled If debug enabled then SSH will be enabled inbound on the NSG bool false no
ip_configuration_name Name of the IP Config on the VMs NIC. string "primary" no
location_name_map Each region must have corresponding a shortend name for resource naming purposes map(string)
{
"eastasia": "ase",
"eastus": "use",
"eastus2": "use2",
"northeurope": "eun",
"southeastasia": "asse",
"uksouth": "uks",
"ukwest": "ukw",
"westeurope": "euw",
"westus": "usw"
}
no
network_interface_name Name of the VMs NIC. string "primary" no
overprovision Bool to set overprovisioning. bool false no
subnet_name Name of the Subnet which the VMSS will be provisioned. string "" no
upgrade_mode Upgrade mode for VMSS instances string "Automatic" no
vmss_admin_password Password for Admin SSH Access to VMs. string "" no
vmss_admin_ssh_key SSH Public Key for Admin SSH Access to VMs. string "" no
vmss_admin_username Username for Admin SSH Access to VMs. string "" no
vmss_disable_password_auth Boolean to enable or disable password authentication to VMs. bool false no
vmss_disk_caching Disk Caching options. string "ReadWrite" no
vmss_image_offer Image offer. Eg UbuntuServer string "0001-com-ubuntu-server-jammy" no
vmss_image_publisher Image Publisher. string "Canonical" no
vmss_image_sku Image SKU. string "22_04-lts-gen2" no
vmss_image_version Version of VM Image SKU required. string "latest" no
vmss_instances Default number of instances within the scaleset. number 1 no
vmss_name Name of the VMSS string "" no
vmss_network_profile_lb_backend_pool ID of the Backend pool to attached the VMSS to string "" no
vmss_network_profile_lb_nat_rule ID of the NAT rule to use in the VMSS string "" no
vmss_resource_group_location Location of Resource group string "uksouth" no
vmss_resource_group_name name of resource group string "" no
vmss_sku VM Size string "Standard_B4ms" no
vmss_storage_account_type Storeage type used for VMSS Disk. string "StandardSSD_LRS" no
vnet_name Name of the VNET which the VMSS will be provisioned. string "" no
vnet_resource_group Name of the Resource Group in which the VNET is provisioned. string "" no

Outputs

Name Description
setup_script n/a
vmss_admin_password n/a
vmss_id n/a

Troubleshooting

The following components are installed using the CustomScript extension:

  • Azure DevOps Pipeline Agent
  • PowerShell
  • Docker

If this happens to fail on any of the nodes, the script itself, stdout and stderr output can be found in /var/lib/waagent/custom-script/download/1.

Create Public IP Address Create Load Balancer Add NAT rule for SSH Update NSG to allow SSH Ensure public key is on VMSS resource

About

Terraform module to create a private build agent for Azure DevOps using a Virtual Machine Scale Set

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published