Giter Site home page Giter Site logo

vtb-link / terraform-azurerm-selfhostedrunnervmss Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fortytwoservices/terraform-azurerm-selfhostedrunnervmss

0.0 0.0 0.0 242 KB

Module for creating a simple virtual machine scale set for Azure DevOps and GitHub self hosted runners

License: MIT License

Shell 46.83% PowerShell 7.23% HCL 45.94%

terraform-azurerm-selfhostedrunnervmss's Introduction

Self Hosted Runners Virtual Machine Scale Set

This module deploys a virtual machine scale set for self hosted runners for Azure DevOps and GitHub.

provider "azurerm" {
  features {}
}

module "vmss" {
  source                         = "amestofortytwo/selfhostedrunnervmss/azurerm"
  operating_system               = "ubuntu"       # windows or ubuntu
  runner_platform                = "azure_devops" # azure_devops or github
}

After deploying the virtual machine scale set, you need to configure the Azure DevOps or GitHub side of things according to our documentation:

Requirements

No requirements.

Examples

Minimum

provider "azurerm" {
  features {}
}

module "vmss" {
  source               = "amestofortytwo/selfhostedrunnervmss/azurerm"
  operating_system     = "ubuntu"       # windows or ubuntu
  runner_platform      = "azure_devops" # azure_devops or github
  deploy_load_balancer = true
}

output "password" {
  value = nonsensitive(module.vmss.password)
}

Advanced

provider "azurerm" {
  features {}
}

# Create custom rg
resource "azurerm_resource_group" "rg" {
  location = "westeurope"
  name     = "runners"
}

# Create custom vnet
resource "azurerm_virtual_network" "vmss" {
  name                = "runner-network"
  address_space       = ["10.0.0.0/24"]
  location            = azurerm_resource_group.rg.location
  resource_group_name = azurerm_resource_group.rg.name
}

resource "azurerm_subnet" "vmss" {
  name                 = "vmss"
  resource_group_name  = azurerm_resource_group.rg.name
  virtual_network_name = azurerm_virtual_network.vmss.name
  address_prefixes     = azurerm_virtual_network.vmss.address_space
}

module "vmss" {
  source                          = "amestofortytwo/selfhostedrunnervmss/azurerm"
  operating_system                = "ubuntu"       # windows or ubuntu
  runner_platform                 = "azure_devops" # azure_devops or github
  resource_group_name             = azurerm_resource_group.rg.name
  use_existing_resource_group     = true
  location                        = azurerm_resource_group.rg.location
  virtual_machine_scale_set_name  = "runners"
  sku                             = "Standard_D2s_v3"
  ssh_public_keys                 = ["ssh-rsa AAAAB3NzaC1yc2EAAAADA....QFv2PJ0= marius@42device"]
  subnet_id                       = azurerm_subnet.vmss.id
  use_custom_subnet               = true
  vmss_encryption_at_host_enabled = true
}

output "password" {
  value = nonsensitive(module.vmss.password)
}

Providers

Name Version
azurerm n/a
random n/a

Modules

No modules.

Inputs

Name Description Type Default Required
deploy_load_balancer (Optional) When using the built-in network (use_custom_subnet is false), should we create a NAT gateway? This will be required in the future. Defaults to false. bool false no
enable_accelerated_networking (Optional) Does this Network Interface support Accelerated Networking? Possible values are true and false. Defaults to false. bool false no
enable_automatic_instance_repair Enable automatic instance repair for the VMSS. This will automatically repair instances that fail health checks. bool false no
enable_termination_notifications Enable termination notifications for the VMSS. This will send a notification to the Azure Instance Metadata Service (IMDS) when the VMSS is scheduled for maintenance or when the VMSS is deleted. bool false no
load_balancer_backend_address_pool_id (Optional) Value of the backend address pool id to use for the load balancer. I.e. for static outbound NAT. string "" no
location The Azure region to create the scale set in string "westeurope" no
operating_system The OS of the runners string "ubuntu" no
password Password of the local user acocunt string null no
resource_group_name The resource group name to create string "self-hosted-runners" no
runner_platform Whether it is github or azure_devops used for runners string "azure_devops" no
sku The sku to create virtual machines with string "Standard_D2s_v3" no
ssh_public_keys n/a list(string) [] no
subnet_id When provided, this subnet will be used for the scale set, rather than creating a new virtual network and subnet string null no
tags n/a map(any) {} no
use_custom_subnet Set to true if subnet_id is provided in order to actually use it (works around a TF issue) bool false no
use_existing_resource_group Whether to use an existing resource group or not bool false no
username Username of the local user account string "runneradmin" no
virtual_machine_scale_set_name n/a string "self-hosted-runners" no
vmss_encryption_at_host_enabled Enables encryption at host for the VMSS virtual machines. In order to use this option, the EncryptionAtHost feature must be enabled for Microsoft.Compue resource provider must be enabled for the subscription. To enable, use this PowerShell command: Register-AzProviderFeature -FeatureName 'EncryptionAtHost' -ProviderNamespace 'Microsoft.Compute'. bool false no

Outputs

Name Description
password n/a
virtual_machine_scale_set_id n/a

Resources

Name Type
azurerm_lb.load_balancer resource
azurerm_lb_backend_address_pool.load_balancer resource
azurerm_lb_outbound_rule.outbound_rule resource
azurerm_linux_virtual_machine_scale_set.self_hosted_runners resource
azurerm_public_ip.load_balancer_pip resource
azurerm_resource_group.rg resource
azurerm_subnet.vmss resource
azurerm_virtual_network.vmss resource
azurerm_windows_virtual_machine_scale_set.self_hosted_runners resource
random_password.password resource

terraform-azurerm-selfhostedrunnervmss's People

Contributors

mysteq avatar dependabot[bot] avatar mariussm avatar 4t2-marvin avatar github-actions[bot] avatar oldking139 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.