@@ -10,45 +10,45 @@ terraform {
1010}
1111
1212variable "display_name" {
13- default = " AWS Region"
14- description = " The display name of the parameter."
15- type = string
13+ default = " AWS Region"
14+ description = " The display name of the parameter."
15+ type = string
1616}
1717
1818variable "description" {
19- default = " The region to deploy workspace infrastructure."
20- description = " The description of the parameter."
21- type = string
19+ default = " The region to deploy workspace infrastructure."
20+ description = " The description of the parameter."
21+ type = string
2222}
2323
2424variable "default" {
25- default = " us-east-1"
26- description = " The default region to use if no region is specified."
27- type = string
25+ default = " us-east-1"
26+ description = " The default region to use if no region is specified."
27+ type = string
2828}
2929
3030variable "mutable" {
31- default = false
32- description = " Whether the parameter can be changed after creation."
33- type = bool
31+ default = false
32+ description = " Whether the parameter can be changed after creation."
33+ type = bool
3434}
3535
3636variable "custom_names" {
37- default = {}
38- description = " A map of custom display names for region IDs."
39- type = map (string )
37+ default = {}
38+ description = " A map of custom display names for region IDs."
39+ type = map (string )
4040}
4141
4242variable "custom_icons" {
43- default = {}
44- description = " A map of custom icons for region IDs."
45- type = map (string )
43+ default = {}
44+ description = " A map of custom icons for region IDs."
45+ type = map (string )
4646}
4747
4848variable "exclude" {
49- default = []
50- description = " A list of region IDs to exclude."
51- type = list (string )
49+ default = []
50+ description = " A list of region IDs to exclude."
51+ type = list (string )
5252}
5353
5454locals {
@@ -57,92 +57,92 @@ locals {
5757 # the provider, which requires a region.
5858 regions = {
5959 " ap-northeast-1" = {
60- name = " Asia Pacific (Tokyo)"
61- icon = " /emojis/1f1ef-1f1f5.png"
62- }
63- " ap-northeast-2" = {
64- name = " Asia Pacific (Seoul)"
65- icon = " /emojis/1f1f0-1f1f7.png"
66- }
67- " ap-northeast-3" = {
68- name = " Asia Pacific (Osaka)"
69- icon = " /emojis/1f1ef-1f1f5.png"
70- }
71- " ap-south-1" = {
72- name = " Asia Pacific (Mumbai)"
73- icon = " /emojis/1f1ee-1f1f3.png"
74- }
75- " ap-southeast-1" = {
76- name = " Asia Pacific (Singapore)"
77- icon = " /emojis/1f1f8-1f1ec.png"
78- }
79- " ap-southeast-2" = {
80- name = " Asia Pacific (Sydney)"
81- icon = " /emojis/1f1e6-1f1fa.png"
82- }
83- " ca-central-1" = {
84- name = " Canada (Central)"
85- icon = " /emojis/1f1e8-1f1e6.png"
86- }
87- " eu-central-1" = {
88- name = " EU (Frankfurt)"
89- icon = " /emojis/1f1ea-1f1fa.png"
90- }
91- " eu-north-1" = {
92- name = " EU (Stockholm)"
93- icon = " /emojis/1f1ea-1f1fa.png"
94- }
95- " eu-west-1" = {
96- name = " EU (Ireland)"
97- icon = " /emojis/1f1ea-1f1fa.png"
98- }
99- " eu-west-2" = {
100- name = " EU (London)"
101- icon = " /emojis/1f1ea-1f1fa.png"
102- }
103- " eu-west-3" = {
104- name = " EU (Paris)"
105- icon = " /emojis/1f1ea-1f1fa.png"
106- }
107- " sa-east-1" = {
108- name = " South America (São Paulo)"
109- icon = " /emojis/1f1e7-1f1f7.png"
110- }
111- " us-east-1" = {
112- name = " US East (N. Virginia)"
113- icon = " /emojis/1f1fa-1f1f8.png"
114- }
115- " us-east-2" = {
116- name = " US East (Ohio)"
117- icon = " /emojis/1f1fa-1f1f8.png"
118- }
119- " us-west-1" = {
120- name = " US West (N. California)"
121- icon = " /emojis/1f1fa-1f1f8.png"
122- }
123- " us-west-2" = {
124- name = " US West (Oregon)"
125- icon = " /emojis/1f1fa-1f1f8.png"
126- }
60+ name = " Asia Pacific (Tokyo)"
61+ icon = " /emojis/1f1ef-1f1f5.png"
62+ }
63+ " ap-northeast-2" = {
64+ name = " Asia Pacific (Seoul)"
65+ icon = " /emojis/1f1f0-1f1f7.png"
66+ }
67+ " ap-northeast-3" = {
68+ name = " Asia Pacific (Osaka)"
69+ icon = " /emojis/1f1ef-1f1f5.png"
70+ }
71+ " ap-south-1" = {
72+ name = " Asia Pacific (Mumbai)"
73+ icon = " /emojis/1f1ee-1f1f3.png"
74+ }
75+ " ap-southeast-1" = {
76+ name = " Asia Pacific (Singapore)"
77+ icon = " /emojis/1f1f8-1f1ec.png"
78+ }
79+ " ap-southeast-2" = {
80+ name = " Asia Pacific (Sydney)"
81+ icon = " /emojis/1f1e6-1f1fa.png"
82+ }
83+ " ca-central-1" = {
84+ name = " Canada (Central)"
85+ icon = " /emojis/1f1e8-1f1e6.png"
86+ }
87+ " eu-central-1" = {
88+ name = " EU (Frankfurt)"
89+ icon = " /emojis/1f1ea-1f1fa.png"
90+ }
91+ " eu-north-1" = {
92+ name = " EU (Stockholm)"
93+ icon = " /emojis/1f1ea-1f1fa.png"
94+ }
95+ " eu-west-1" = {
96+ name = " EU (Ireland)"
97+ icon = " /emojis/1f1ea-1f1fa.png"
98+ }
99+ " eu-west-2" = {
100+ name = " EU (London)"
101+ icon = " /emojis/1f1ea-1f1fa.png"
102+ }
103+ " eu-west-3" = {
104+ name = " EU (Paris)"
105+ icon = " /emojis/1f1ea-1f1fa.png"
106+ }
107+ " sa-east-1" = {
108+ name = " South America (São Paulo)"
109+ icon = " /emojis/1f1e7-1f1f7.png"
110+ }
111+ " us-east-1" = {
112+ name = " US East (N. Virginia)"
113+ icon = " /emojis/1f1fa-1f1f8.png"
114+ }
115+ " us-east-2" = {
116+ name = " US East (Ohio)"
117+ icon = " /emojis/1f1fa-1f1f8.png"
118+ }
119+ " us-west-1" = {
120+ name = " US West (N. California)"
121+ icon = " /emojis/1f1fa-1f1f8.png"
122+ }
123+ " us-west-2" = {
124+ name = " US West (Oregon)"
125+ icon = " /emojis/1f1fa-1f1f8.png"
126+ }
127127 }
128128}
129129
130130data "coder_parameter" "region" {
131- name = " aws_region"
132- display_name = var. display_name
133- description = var. description
134- default = var. default
135- mutable = var. mutable
136- dynamic "option" {
137- for_each = { for k , v in local . regions : k => v if ! (contains (var. exclude , k)) }
138- content {
139- name = try (var. custom_names [option . key ], option. value . name )
140- icon = try (var. custom_icons [option . key ], option. value . icon )
141- value = option. key
142- }
131+ name = " aws_region"
132+ display_name = var. display_name
133+ description = var. description
134+ default = var. default
135+ mutable = var. mutable
136+ dynamic "option" {
137+ for_each = { for k , v in local . regions : k => v if ! (contains (var. exclude , k)) }
138+ content {
139+ name = try (var. custom_names [option . key ], option. value . name )
140+ icon = try (var. custom_icons [option . key ], option. value . icon )
141+ value = option. key
143142 }
143+ }
144144}
145145
146146output "value" {
147- value = data. coder_parameter . region . value
147+ value = data. coder_parameter . region . value
148148}
0 commit comments