Skip to content

Instantly share code, notes, and snippets.

@rssnyder
Created December 27, 2023 18:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rssnyder/40ebf23bc352a2fbf75005239367abcd to your computer and use it in GitHub Desktop.
Save rssnyder/40ebf23bc352a2fbf75005239367abcd to your computer and use it in GitHub Desktop.
run a harness delegate in azure aci
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "=3.0.0"
}
}
}
provider "azurerm" {
features {}
}
variable "delegate_token" {
type = string
sensitive = true
}
variable "harness_account_id" {
type = string
}
variable "resource_group" {
type = string
}
data "azurerm_subscription" "current" {}
data "azurerm_resource_group" "this" {
name = var.resource_group
}
resource "azurerm_container_group" "delegate" {
name = "harness-delegate-ng"
location = data.azurerm_resource_group.this.location
resource_group_name = data.azurerm_resource_group.this.name
ip_address_type = "None"
os_type = "Linux"
container {
name = "delegate"
image = "harness/delegate:23.12.81808"
cpu = "1"
memory = "2"
environment_variables = {
DELEGATE_NAME = "aci"
NEXT_GEN = "true"
DELEGATE_TYPE = "DOCKER"
ACCOUNT_ID = var.harness_account_id
LOG_STREAMING_SERVICE_URL = "https://app.harness.io/gratis/log-service/" # change based on your account
MANAGER_HOST_AND_PORT = "https://app.harness.io/gratis" # change based on your account
}
secure_environment_variables = {
DELEGATE_TOKEN = var.delegate_token
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment