From ca52f1f8b308ab064728ca2067c83c0e9534f3fa Mon Sep 17 00:00:00 2001 From: Ethan Dickson Date: Wed, 14 Aug 2024 04:15:15 +0000 Subject: [PATCH 1/2] docs: clarify `coder_metadata` usage --- docs/resources/metadata.md | 7 +++++-- provider/metadata.go | 4 +++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/resources/metadata.md b/docs/resources/metadata.md index f739db14..03896798 100644 --- a/docs/resources/metadata.md +++ b/docs/resources/metadata.md @@ -3,12 +3,15 @@ page_title: "coder_metadata Resource - terraform-provider-coder" subcategory: "" description: |- - Use this resource to attach metadata to a resource. They will be displayed in the Coder dashboard. + Use this resource to attach metadata to a resource. They will be displayed in the Coder dashboard alongside the resource. The resource containing the agent, and it's metadata, will be shown by default. + Alternatively, to attach metadata to the agent, use a metadata block within a coder_agent resource. --- # coder_metadata (Resource) -Use this resource to attach metadata to a resource. They will be displayed in the Coder dashboard. +Use this resource to attach metadata to a resource. They will be displayed in the Coder dashboard alongside the resource. The resource containing the agent, and it's metadata, will be shown by default. + +Alternatively, to attach metadata to the agent, use a `metadata` block within a `coder_agent` resource. ## Example Usage diff --git a/provider/metadata.go b/provider/metadata.go index abfe0a05..a1e5a6dd 100644 --- a/provider/metadata.go +++ b/provider/metadata.go @@ -14,7 +14,9 @@ func metadataResource() *schema.Resource { SchemaVersion: 1, Description: "Use this resource to attach metadata to a resource. They will be " + - "displayed in the Coder dashboard.", + "displayed in the Coder dashboard alongside the resource. " + + "The resource containing the agent, and it's metadata, will be shown by default. " + "\n\n" + + "Alternatively, to attach metadata to the agent, use a `metadata` block within a `coder_agent` resource.", CreateContext: func(c context.Context, resourceData *schema.ResourceData, i interface{}) diag.Diagnostics { resourceData.SetId(uuid.NewString()) From a0dc9c590bb99b06a3ad9aae84ccbbcc4085e8dc Mon Sep 17 00:00:00 2001 From: Ethan Dickson Date: Thu, 29 Aug 2024 04:04:07 +0000 Subject: [PATCH 2/2] add supports markdown --- docs/resources/metadata.md | 2 +- provider/metadata.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/resources/metadata.md b/docs/resources/metadata.md index 03896798..d8329ea9 100644 --- a/docs/resources/metadata.md +++ b/docs/resources/metadata.md @@ -85,7 +85,7 @@ Required: Optional: - `sensitive` (Boolean) Set to `true` to for items such as API keys whose values should be hidden from view by default. Note that this does not prevent metadata from being retrieved using the API, so it is not suitable for secrets that should not be exposed to workspace users. -- `value` (String) The value of this metadata item. +- `value` (String) The value of this metadata item. Supports basic Markdown, including hyperlinks. Read-Only: diff --git a/provider/metadata.go b/provider/metadata.go index a1e5a6dd..48a3e89d 100644 --- a/provider/metadata.go +++ b/provider/metadata.go @@ -88,7 +88,7 @@ func metadataResource() *schema.Resource { }, "value": { Type: schema.TypeString, - Description: "The value of this metadata item.", + Description: "The value of this metadata item. Supports basic Markdown, including hyperlinks.", ForceNew: true, Optional: true, },