Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4e0acdc

Browse files
Emyrkmatifali
andauthored
chore: implement dogfood template to select region based on user group (#18115)
Co-authored-by: Atif Ali <atif@coder.com>
1 parent232c72f commit4e0acdc

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

‎dogfood/coder/main.tf

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,29 @@ data "coder_parameter" "image_type" {
130130
}
131131
}
132132

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+
forginlocal.user_groups:
146+
local.default_regions[g]ifcontains(keys(local.default_regions), g)
147+
], ["us-pittsburgh"])[0]
148+
}
149+
150+
133151
data"coder_parameter""region" {
134152
type="string"
135153
name="Region"
136154
icon="/emojis/1f30e.png"
137-
default="us-pittsburgh"
155+
default=local.user_region
138156
option {
139157
icon="/emojis/1f1fa-1f1f8.png"
140158
name="Pittsburgh"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp