File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -130,11 +130,29 @@ data "coder_parameter" "image_type" {
130
130
}
131
131
}
132
132
133
+ locals {
134
+ default_regions = {
135
+ // keys should match group names
136
+ " north-america" : " us-pittsburgh"
137
+ " europe" : " eu-helsinki"
138
+ " australia" : " ap-sydney"
139
+ " south-america" : " sa-saopaulo"
140
+ " africa" : " za-cpt"
141
+ }
142
+
143
+ user_groups = data. coder_workspace_owner . me . groups
144
+ user_region = coalescelist ([
145
+ for g in local . user_groups :
146
+ local . default_regions [g ] if contains (keys (local. default_regions ), g)
147
+ ], [" us-pittsburgh" ])[0 ]
148
+ }
149
+
150
+
133
151
data "coder_parameter" "region" {
134
152
type = " string"
135
153
name = " Region"
136
154
icon = " /emojis/1f30e.png"
137
- default = " us-pittsburgh "
155
+ default = local . user_region
138
156
option {
139
157
icon = " /emojis/1f1fa-1f1f8.png"
140
158
name = " Pittsburgh"
You can’t perform that action at this time.
0 commit comments