@@ -13,33 +13,31 @@ provider "azurerm" {
13
13
features {}
14
14
}
15
15
16
- provider "coder" {
16
+ provider "coder" {}
17
+ data "coder_workspace" "me" {}
18
+
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"
17
27
}
18
28
19
- data "coder_workspace" "me" {}
29
+ # See https://registry.coder.com/modules/windows-rdp
30
+ module "windows_rdp" {
31
+ source = " registry.coder.com/modules/windows-rdp/coder"
20
32
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
- }
33
+ # This ensures that the latest version of the module gets downloaded, you can also pin the module version to prevent breaking changes in production.
34
+ version = " >= 1.0.0"
35
+
36
+ admin_username = local. admin_username
37
+ admin_password = random_password. admin_password . result
38
+
39
+ agent_id = resource. coder_agent . main . id
40
+ resource_id = null # Unused, to be removed in a future version
43
41
}
44
42
45
43
data "coder_parameter" "data_disk_size" {
@@ -77,7 +75,7 @@ locals {
77
75
78
76
resource "azurerm_resource_group" "main" {
79
77
name = " ${ local . prefix } -${ data . coder_workspace . me . id } "
80
- location = data . coder_parameter . location . value
78
+ location = module . azure_region . value
81
79
tags = {
82
80
Coder_Provisioned = " true"
83
81
}
0 commit comments