Skip to content

Commit

Permalink
Clarify pricing; make machine sizes configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
chvancooten committed Apr 7, 2022
1 parent 88aa48b commit 6ce109f
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 9 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ Provisioning scripts for an Active Directory lab environment. Designed to be dep

## Setup

The lab is provisioned automatically using Terraform and Ansible. First, Terraform deploys all the infrastructure and prepares the machines for provisioning. It then kicks off a role-based Ansible playbook from the Debian attacker machine to provision the Windows-based machines.
The lab is provisioned automatically using Terraform and Ansible. First, Terraform deploys all the infrastructure and prepares the machines for provisioning. It then kicks off a role-based Ansible playbook from the Debian attacker machine to provision the Windows-based machines. The full process takes about 15 to 20 minutes to complete.

**In the default setup, the lab takes approximately 15-20 minutes to provision, and costs about €1 per day to run on Azure.**
> 💸 **Note:** The machine sizes are moderately large by default ('Standard_B4ms'). In my testing the bill was approx. €10 per day of active use, your mileage may vary. Change the appropriate 'size' settings in `terraform.tfvars` to change machine sizes.
### Deployment

Expand Down
2 changes: 1 addition & 1 deletion Terraform/03-dc.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ resource "azurerm_network_interface" "cloudlabs-vm-dc-nic" {
resource "azurerm_windows_virtual_machine" "cloudlabs-vm-dc" {
name = "CloudLabs-vm-dc"
computer_name = var.dc-hostname
size = "Standard_B4ms"
size = var.dc-size
provision_vm_agent = true
enable_automatic_updates = true
resource_group_name = data.azurerm_resource_group.cloudlabs-rg.name
Expand Down
2 changes: 1 addition & 1 deletion Terraform/04-winserv2019.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ resource "azurerm_network_interface_nat_rule_association" "cloudlabs-vm-winserv2
resource "azurerm_windows_virtual_machine" "cloudlabs-vm-winserv2019" {
name = "CloudLabs-vm-winserv2019"
computer_name = var.winserv2019-hostname
size = "Standard_B4ms"
size = var.winserv2019-size
provision_vm_agent = true
enable_automatic_updates = true
resource_group_name = data.azurerm_resource_group.cloudlabs-rg.name
Expand Down
2 changes: 1 addition & 1 deletion Terraform/05-windows10.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ resource "azurerm_network_interface_nat_rule_association" "cloudlabs-vm-windows1
resource "azurerm_windows_virtual_machine" "cloudlabs-vm-windows10" {
name = "CloudLabs-vm-windows10"
computer_name = var.win10-hostname
size = "Standard_B4ms"
size = var.win10-size
provision_vm_agent = true
enable_automatic_updates = true
resource_group_name = data.azurerm_resource_group.cloudlabs-rg.name
Expand Down
2 changes: 1 addition & 1 deletion Terraform/06-elastic.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ resource "azurerm_linux_virtual_machine" "cloudlabs-vm-elastic" {
computer_name = var.elastic-hostname
resource_group_name = data.azurerm_resource_group.cloudlabs-rg.name
location = data.azurerm_resource_group.cloudlabs-rg.location
size = "Standard_D4ds_v5"
size = var.elastic-size
disable_password_authentication = false
admin_username = var.linux-user
admin_password = random_string.linuxpass.result
Expand Down
2 changes: 1 addition & 1 deletion Terraform/07-hackbox.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ resource "azurerm_linux_virtual_machine" "cloudlabs-vm-hackbox" {
computer_name = var.hackbox-hostname
resource_group_name = data.azurerm_resource_group.cloudlabs-rg.name
location = data.azurerm_resource_group.cloudlabs-rg.location
size = "Standard_B2s"
size = var.hackbox-size
disable_password_authentication = false
admin_username = var.linux-user
admin_password = random_string.linuxpass.result
Expand Down
9 changes: 7 additions & 2 deletions Terraform/terraform.tfvars.example
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,15 @@ ip-whitelist = ["1.2.3.4/32", "8.8.8.0/24"]
timezone = "W. Europe Standard Time"
domain-name-label = "cloudlabs"
domain-dns-name = "cloud.labs"
windows-user = "labadmin"
linux-user = "labadmin"
hackbox-hostname = "hackbox"
elastic-hostname = "elastic"
dc-hostname = "dc"
winserv2019-hostname = "winserv2019"
win10-hostname = "win10"
windows-user = "labadmin"
linux-user = "labadmin"
win10-size = "Standard_B4ms"
winserv2019-size = "Standard_B4ms"
dc-size = "Standard_B4ms"
elastic-size = "Standard_B4ms"
hackbox-size = "Standard_B4ms"
30 changes: 30 additions & 0 deletions Terraform/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,30 +32,60 @@ variable "hackbox-hostname" {
default = "hackbox"
}

variable "hackbox-size" {
type = string
description = "The machine size of the attacker VM."
default = "Standard_B4ms"
}

variable "elastic-hostname" {
type = string
description = "The hostname of the Elastic VM."
default = "elastic"
}

variable "elastic-size" {
type = string
description = "The machine size of the Elastic VM."
default = "Standard_B4ms"
}

variable "dc-hostname" {
type = string
description = "The hostname of the Windows Server 2016 DC VM."
default = "dc"
}

variable "dc-size" {
type = string
description = "The machine size of the Windows Server 2016 DC VM."
default = "Standard_B4ms"
}

variable "winserv2019-hostname" {
type = string
description = "The hostname of the Windows Server 2019 VM."
default = "winserv2019"
}

variable "winserv2019-size" {
type = string
description = "The machine size of the Windows Server 2019 VM."
default = "Standard_B4ms"
}

variable "win10-hostname" {
type = string
description = "The hostname of the Windows 10 VM."
default = "win10"
}

variable "win10-size" {
type = string
description = "The machine size of the Windows 10 VM."
default = "Standard_B4ms"
}

variable "windows-user" {
type = string
description = "The local administrative username for Windows machines. Password will be generated."
Expand Down

0 comments on commit 6ce109f

Please sign in to comment.