From 396855fc74e6f8de448e7d4226b340c91b75fca3 Mon Sep 17 00:00:00 2001 From: Phorcys <57866459+phorcys420@users.noreply.github.com> Date: Thu, 14 Nov 2024 15:23:43 +0000 Subject: [PATCH 1/2] feat(example/templates/azure-windows): use azure region module --- examples/templates/azure-windows/main.tf | 36 +++++++----------------- 1 file changed, 10 insertions(+), 26 deletions(-) diff --git a/examples/templates/azure-windows/main.tf b/examples/templates/azure-windows/main.tf index 9ff5bcbf4e0a4..ec09ad3db59f5 100644 --- a/examples/templates/azure-windows/main.tf +++ b/examples/templates/azure-windows/main.tf @@ -13,33 +13,17 @@ provider "azurerm" { features {} } -provider "coder" { -} - +provider "coder" {} data "coder_workspace" "me" {} -data "coder_parameter" "location" { - description = "What location should your workspace live in?" - display_name = "Location" - name = "location" - default = "eastus" - mutable = false - option { - value = "eastus" - name = "East US" - } - option { - value = "centralus" - name = "Central US" - } - option { - value = "southcentralus" - name = "South Central US" - } - option { - value = "westus2" - name = "West US 2" - } +# See https://registry.coder.com/modules/azure-region +module "azure_region" { + source = "registry.coder.com/modules/azure-region/coder" + + # This ensures that the latest version of the module gets downloaded, you can also pin the module version to prevent breaking changes in production. + version = ">= 1.0.0" + + default = "eastus" } data "coder_parameter" "data_disk_size" { @@ -77,7 +61,7 @@ locals { resource "azurerm_resource_group" "main" { name = "${local.prefix}-${data.coder_workspace.me.id}" - location = data.coder_parameter.location.value + location = module.azure_region.value tags = { Coder_Provisioned = "true" } From 4e2fc4f86c2f1cd70b13a43fda664653710413ac Mon Sep 17 00:00:00 2001 From: Phorcys <57866459+phorcys420@users.noreply.github.com> Date: Tue, 7 Jan 2025 18:28:59 +0000 Subject: [PATCH 2/2] chore: add `web-rdp` module --- examples/templates/azure-windows/main.tf | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/examples/templates/azure-windows/main.tf b/examples/templates/azure-windows/main.tf index ec09ad3db59f5..518ff8f5875d0 100644 --- a/examples/templates/azure-windows/main.tf +++ b/examples/templates/azure-windows/main.tf @@ -18,7 +18,7 @@ data "coder_workspace" "me" {} # See https://registry.coder.com/modules/azure-region module "azure_region" { - source = "registry.coder.com/modules/azure-region/coder" + source = "registry.coder.com/modules/azure-region/coder" # This ensures that the latest version of the module gets downloaded, you can also pin the module version to prevent breaking changes in production. version = ">= 1.0.0" @@ -26,6 +26,20 @@ module "azure_region" { default = "eastus" } +# See https://registry.coder.com/modules/windows-rdp +module "windows_rdp" { + source = "registry.coder.com/modules/windows-rdp/coder" + + # This ensures that the latest version of the module gets downloaded, you can also pin the module version to prevent breaking changes in production. + version = ">= 1.0.0" + + admin_username = local.admin_username + admin_password = random_password.admin_password.result + + agent_id = resource.coder_agent.main.id + resource_id = null # Unused, to be removed in a future version +} + data "coder_parameter" "data_disk_size" { description = "Size of your data (F:) drive in GB" display_name = "Data disk size"