Skip to content

Commit 49eb214

Browse files
committed
feat(example/templates/azure-windows): use azure region module
1 parent 6b1fafb commit 49eb214

File tree

1 file changed

+10
-26
lines changed
  • examples/templates/azure-windows

1 file changed

+10
-26
lines changed

examples/templates/azure-windows/main.tf

+10-26
Original file line numberDiff line numberDiff line change
@@ -13,33 +13,17 @@ provider "azurerm" {
1313
features {}
1414
}
1515

16-
provider "coder" {
17-
}
18-
16+
provider "coder" {}
1917
data "coder_workspace" "me" {}
2018

21-
data "coder_parameter" "location" {
22-
description = "What location should your workspace live in?"
23-
display_name = "Location"
24-
name = "location"
25-
default = "eastus"
26-
mutable = false
27-
option {
28-
value = "eastus"
29-
name = "East US"
30-
}
31-
option {
32-
value = "centralus"
33-
name = "Central US"
34-
}
35-
option {
36-
value = "southcentralus"
37-
name = "South Central US"
38-
}
39-
option {
40-
value = "westus2"
41-
name = "West US 2"
42-
}
19+
# See https://registry.coder.com/modules/azure-region
20+
module "azure_region" {
21+
source = "registry.coder.com/modules/azure-region/coder"
22+
23+
# This ensures that the latest version of the module gets downloaded, you can also pin the module version to prevent breaking changes in production.
24+
version = ">= 1.0.0"
25+
26+
default = "eastus"
4327
}
4428

4529
data "coder_parameter" "data_disk_size" {
@@ -77,7 +61,7 @@ locals {
7761

7862
resource "azurerm_resource_group" "main" {
7963
name = "${local.prefix}-${data.coder_workspace.me.id}"
80-
location = data.coder_parameter.location.value
64+
location = module.azure_region.value
8165
tags = {
8266
Coder_Provisioned = "true"
8367
}

0 commit comments

Comments
 (0)