Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
6 changes: 6 additions & 0 deletions internal/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,12 @@ func New() *schema.Provider {
ForceNew: true,
Required: true,
},
"hide": {
Type: schema.TypeBool,
Description: "Hide the resource from the UI.",
ForceNew: true,
Optional: true,
},
"item": {
Type: schema.TypeList,
Description: "Each \"item\" block defines a single metadata item consisting of a key/value pair.",
Expand Down
2 changes: 2 additions & 0 deletions internal/provider/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ func TestMetadata(t *testing.T) {
}
resource "coder_metadata" "agent" {
resource_id = coder_agent.dev.id
hide = true
item {
key = "foo"
value = "bar"
Expand Down Expand Up @@ -295,6 +296,7 @@ func TestMetadata(t *testing.T) {
t.Logf("metadata attributes: %#v", metadata.Primary.Attributes)
for key, expected := range map[string]string{
"resource_id": agent.Primary.Attributes["id"],
"hide": agent.Primary.Attributes["hide"],
"item.#": "5",
"item.0.key": "foo",
"item.0.value": "bar",
Expand Down