Skip to content

Commit e9fd608

Browse files
committed
chore!: use map over list for template tf_vars & provisioner_tags
1 parent 9321b39 commit e9fd608

File tree

5 files changed

+811
-302
lines changed

5 files changed

+811
-302
lines changed

examples/provider/provider.tf

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,9 @@ resource "coderd_template" "example" {
3838
versions = [{
3939
directory = "./example-template"
4040
active = true
41-
tf_vars = [{
42-
name = "image_id"
43-
value = "ami-12345678"
44-
}]
41+
tf_vars = {
42+
"image_id" = "ami-12345678"
43+
}
4544
# Version names can be randomly generated if null/omitted
4645
}]
4746
acl = {

integration/template-test/main.tf

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,22 +43,16 @@ resource "coderd_template" "sample" {
4343
{
4444
directory = "./example-template-2"
4545
active = true
46-
tf_vars = [
47-
{
48-
name = "name"
49-
value = "world"
50-
},
51-
]
46+
tf_vars = {
47+
name = "world"
48+
}
5249
},
5350
{
5451
directory = "./example-template-2"
5552
active = false
56-
tf_vars = [
57-
{
58-
name = "name"
59-
value = "ethan"
60-
},
61-
]
53+
tf_vars = {
54+
name = "ethan"
55+
}
6256
}
6357
]
6458
}

internal/provider/template_data_source_test.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,8 @@ func TestAccTemplateDataSource(t *testing.T) {
3434
Name: types.StringValue("main"),
3535
Message: types.StringValue("Initial commit"),
3636
Directory: types.StringValue("../../integration/template-test/example-template/"),
37-
TerraformVariables: []Variable{
38-
{
39-
Name: types.StringValue("name"),
40-
Value: types.StringValue("world"),
41-
},
37+
TerraformVariables: map[string]string{
38+
"name": "world",
4239
},
4340
},
4441
})

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy