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

DNM: chore!: use map over list for template tf_vars & provisioner_tags#124

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
ethanndickson wants to merge1 commit intomain
base:main
Choose a base branch
Loading
fromethan/attr-map-change
Draft
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletionsdocs/index.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -58,10 +58,9 @@ resource "coderd_template" "example" {
versions = [{
directory = "./example-template"
active = true
tf_vars = [{
name = "image_id"
value = "ami-12345678"
}]
tf_vars = {
"image_id" = "ami-12345678"
}
# Version names can be randomly generated if null/omitted
}]
acl = {
Expand Down
22 changes: 2 additions & 20 deletionsdocs/resources/template.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -100,32 +100,14 @@ Optional:
- `active` (Boolean) Whether this version is the active version of the template. Only one version can be active at a time.
- `message` (String) A message describing the changes in this version of the template. Messages longer than 72 characters will be truncated.
- `name` (String) The name of the template version. Automatically generated if not provided. If provided, the name *must* change each time the directory contents, or the `tf_vars` attribute are updated.
- `provisioner_tags` (Attributes Set) Provisioner tags for the template version. (see [below for nested schema](#nestedatt--versions--provisioner_tags))
- `tf_vars` (Attributes Set) Terraform variables for the template version. (see [below for nested schema](#nestedatt--versions--tf_vars))
- `provisioner_tags` (Map of String) Provisioner tags for the template version.
- `tf_vars` (Map of String) Terraform variables for the template version.

Read-Only:

- `directory_hash` (String)
- `id` (String)

<a id="nestedatt--versions--provisioner_tags"></a>
### Nested Schema for `versions.provisioner_tags`

Required:

- `name` (String)
- `value` (String)


<a id="nestedatt--versions--tf_vars"></a>
### Nested Schema for `versions.tf_vars`

Required:

- `name` (String)
- `value` (String)



<a id="nestedatt--acl"></a>
### Nested Schema for `acl`
Expand Down
7 changes: 3 additions & 4 deletionsexamples/provider/provider.tf
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -38,10 +38,9 @@ resource "coderd_template" "example" {
versions = [{
directory = "./example-template"
active = true
tf_vars = [{
name = "image_id"
value = "ami-12345678"
}]
tf_vars = {
"image_id" = "ami-12345678"
}
# Version names can be randomly generated if null/omitted
}]
acl = {
Expand Down
18 changes: 6 additions & 12 deletionsintegration/template-test/main.tf
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -43,22 +43,16 @@ resource "coderd_template" "sample" {
{
directory = "./example-template-2"
active = true
tf_vars = [
{
name = "name"
value = "world"
},
]
tf_vars = {
name = "world"
}
},
{
directory = "./example-template-2"
active = false
tf_vars = [
{
name = "name"
value = "ethan"
},
]
tf_vars = {
name = "ethan"
}
}
]
}
Expand Down
7 changes: 2 additions & 5 deletionsinternal/provider/template_data_source_test.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -34,11 +34,8 @@ func TestAccTemplateDataSource(t *testing.T) {
Name: types.StringValue("main"),
Message: types.StringValue("Initial commit"),
Directory: types.StringValue("../../integration/template-test/example-template/"),
TerraformVariables: []Variable{
{
Name: types.StringValue("name"),
Value: types.StringValue("world"),
},
TerraformVariables: map[string]string{
"name": "world",
},
},
})
Expand Down
Loading
Loading

[8]ページ先頭

©2009-2025 Movatter.jp