File tree Expand file tree Collapse file tree 2 files changed +18
-7
lines changed
examples/resources/coder_parameter Expand file tree Collapse file tree 2 files changed +18
-7
lines changed Original file line number Diff line number Diff line change @@ -41,16 +41,18 @@ data "coder_parameter" "is_public_instance" {
41
41
}
42
42
43
43
data "coder_parameter" "cores" {
44
- name = " CPU Cores"
45
- type = " number"
46
- icon = " /icon/cpu.svg"
47
- default = 3
44
+ name = " CPU Cores"
45
+ type = " number"
46
+ icon = " /icon/cpu.svg"
47
+ default = 3
48
+ priority = 10
48
49
}
49
50
50
51
data "coder_parameter" "disk_size" {
51
- name = " Disk Size"
52
- type = " number"
53
- default = " 5"
52
+ name = " Disk Size"
53
+ type = " number"
54
+ default = " 5"
55
+ priority = 8
54
56
validation {
55
57
# This can apply to number.
56
58
min = 0
Original file line number Diff line number Diff line change @@ -57,6 +57,8 @@ type Parameter struct {
57
57
Validation []Validation
58
58
Optional bool
59
59
60
+ Priority int
61
+
60
62
LegacyVariableName string `mapstructure:"legacy_variable_name"`
61
63
LegacyVariable string `mapstructure:"legacy_variable"`
62
64
}
@@ -90,6 +92,7 @@ func parameterDataSource() *schema.Resource {
90
92
Option interface {}
91
93
Validation interface {}
92
94
Optional interface {}
95
+ Priority interface {}
93
96
94
97
LegacyVariableName interface {}
95
98
LegacyVariable interface {}
@@ -122,6 +125,7 @@ func parameterDataSource() *schema.Resource {
122
125
rd .Set ("optional" , val )
123
126
return val
124
127
}(),
128
+ Priority : rd .Get ("priority" ),
125
129
LegacyVariableName : rd .Get ("legacy_variable_name" ),
126
130
LegacyVariable : rd .Get ("legacy_variable" ),
127
131
}, & parameter )
@@ -331,6 +335,11 @@ func parameterDataSource() *schema.Resource {
331
335
Computed : true ,
332
336
Description : "Whether this value is optional." ,
333
337
},
338
+ "priority" : {
339
+ Type : schema .TypeInt ,
340
+ Optional : true ,
341
+ Description : "The priority of template parameters determines their position ahead of parameters with lower priorities in the UI/CLI presentation." ,
342
+ },
334
343
"legacy_variable_name" : {
335
344
Type : schema .TypeString ,
336
345
Optional : true ,
You can’t perform that action at this time.
0 commit comments