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" {
4141}
4242
4343data "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
4849}
4950
5051data "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
5456 validation {
5557 # This can apply to number.
5658 min = 0
Original file line number Diff line number Diff line change @@ -57,6 +57,8 @@ type Parameter struct {
5757 Validation []Validation
5858 Optional bool
5959
60+ Priority int
61+
6062 LegacyVariableName string `mapstructure:"legacy_variable_name"`
6163 LegacyVariable string `mapstructure:"legacy_variable"`
6264}
@@ -90,6 +92,7 @@ func parameterDataSource() *schema.Resource {
9092 Option interface {}
9193 Validation interface {}
9294 Optional interface {}
95+ Priority interface {}
9396
9497 LegacyVariableName interface {}
9598 LegacyVariable interface {}
@@ -122,6 +125,7 @@ func parameterDataSource() *schema.Resource {
122125 rd .Set ("optional" , val )
123126 return val
124127 }(),
128+ Priority : rd .Get ("priority" ),
125129 LegacyVariableName : rd .Get ("legacy_variable_name" ),
126130 LegacyVariable : rd .Get ("legacy_variable" ),
127131 }, & parameter )
@@ -331,6 +335,11 @@ func parameterDataSource() *schema.Resource {
331335 Computed : true ,
332336 Description : "Whether this value is optional." ,
333337 },
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+ },
334343 "legacy_variable_name" : {
335344 Type : schema .TypeString ,
336345 Optional : true ,
You can’t perform that action at this time.
0 commit comments