@@ -10,7 +10,127 @@ description: |-
10
10
11
11
Use this data source to configure editable options for workspaces.
12
12
13
-
13
+ ## Example Usage
14
+
15
+ ``` terraform
16
+ provider "coder" {}
17
+
18
+ data "coder_parameter" "example" {
19
+ name = "Region"
20
+ description = "Specify a region to place your workspace."
21
+ mutable = false
22
+ type = "string"
23
+ default = "asia-central1-a"
24
+ option {
25
+ value = "us-central1-a"
26
+ name = "US Central"
27
+ icon = "/icon/usa.svg"
28
+ }
29
+ option {
30
+ value = "asia-central1-a"
31
+ name = "Asia"
32
+ icon = "/icon/asia.svg"
33
+ }
34
+ }
35
+
36
+ data "coder_parameter" "ami" {
37
+ name = "Machine Image"
38
+ description = <<-EOT
39
+ # Provide the machine image
40
+ See the [registry](https://container.registry.blah/namespace) for options.
41
+ EOT
42
+ option {
43
+ value = "ami-xxxxxxxx"
44
+ name = "Ubuntu"
45
+ icon = "/icon/ubuntu.svg"
46
+ }
47
+ }
48
+
49
+ data "coder_parameter" "is_public_instance" {
50
+ name = "Is public instance?"
51
+ type = "bool"
52
+ icon = "/icon/docker.svg"
53
+ default = false
54
+ }
55
+
56
+ data "coder_parameter" "cores" {
57
+ name = "CPU Cores"
58
+ type = "number"
59
+ icon = "/icon/cpu.svg"
60
+ default = 3
61
+ order = 10
62
+ }
63
+
64
+ data "coder_parameter" "disk_size" {
65
+ name = "Disk Size"
66
+ type = "number"
67
+ default = "5"
68
+ order = 8
69
+ validation {
70
+ # This can apply to number.
71
+ min = 0
72
+ max = 10
73
+ monotonic = "increasing"
74
+ }
75
+ }
76
+
77
+ data "coder_parameter" "cat_lives" {
78
+ name = "Cat Lives"
79
+ type = "number"
80
+ default = "9"
81
+ validation {
82
+ # This can apply to number.
83
+ min = 0
84
+ max = 10
85
+ monotonic = "decreasing"
86
+ }
87
+ }
88
+
89
+ data "coder_parameter" "fairy_tale" {
90
+ name = "Fairy Tale"
91
+ type = "string"
92
+ mutable = true
93
+ default = "Hansel and Gretel"
94
+ ephemeral = true
95
+ }
96
+
97
+ data "coder_parameter" "users" {
98
+ name = "system_users"
99
+ display_name = "System users"
100
+ type = "list(string)"
101
+ default = jsonencode(["root", "user1", "user2"])
102
+ }
103
+
104
+ data "coder_parameter" "home_volume_size" {
105
+ name = "Home Volume Size"
106
+ description = <<-EOF
107
+ How large should your home volume be?
108
+ EOF
109
+ type = "number"
110
+ default = 30
111
+ mutable = true
112
+ order = 3
113
+
114
+ option {
115
+ name = "30GB"
116
+ value = 30
117
+ }
118
+
119
+ option {
120
+ name = "60GB"
121
+ value = 60
122
+ }
123
+
124
+ option {
125
+ name = "100GB"
126
+ value = 100
127
+ }
128
+
129
+ validation {
130
+ monotonic = "increasing"
131
+ }
132
+ }
133
+ ```
14
134
15
135
<!-- schema generated by tfplugindocs -->
16
136
## Schema
0 commit comments