Skip to content

Instantly share code, notes, and snippets.

@heoelri
Last active July 6, 2021 14:09
Show Gist options
  • Save heoelri/2bdf89154cc92da761ab18e430e78e7e to your computer and use it in GitHub Desktop.
Save heoelri/2bdf89154cc92da761ab18e430e78e7e to your computer and use it in GitHub Desktop.
locust-master-terraform
resource "azurerm_container_group" "master" {
count = var.locustWorkerNodes >= 1 ? 1 : 0
name = "${random_pet.deployment.id}-locust-master"
location = azurerm_resource_group.deployment.location
resource_group_name = azurerm_resource_group.deployment.name
ip_address_type = "Public"
dns_name_label = "${random_pet.deployment.id}-locust-master"
os_type = "Linux"
container {
name = "${random_pet.deployment.id}-locust-master"
image = var.locustVersion
cpu = "2"
memory = "2"
commands = [
"locust",
"--locustfile",
"/home/locust/locust/${azurerm_storage_share_file.locustfile.name}",
"--master",
"--web-auth",
"locust:${azurerm_key_vault_secret.locustsecret.value}",
"--host",
var.targeturl
]
volume {
name = "locust"
mount_path = "/home/locust/locust"
storage_account_key = azurerm_storage_account.deployment.primary_access_key
storage_account_name = azurerm_storage_account.deployment.name
share_name = azurerm_storage_share.locust.name
}
ports {
port = "8089"
protocol = "TCP"
}
ports {
port = "5557"
protocol = "TCP"
}
}
tags = local.default_tags
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment