From f613e9e0ee0f7c8fa295983fd7f5f6e1506f2913 Mon Sep 17 00:00:00 2001
From: McKayla Washburn <mckayla@hey.com>
Date: Wed, 13 Nov 2024 17:19:53 +0000
Subject: [PATCH 1/2] chore: improve `coderd_license` docs

---
 examples/resources/coderd_license/resource.tf | 7 +++++++
 internal/provider/license_resource.go         | 9 ++++++---
 2 files changed, 13 insertions(+), 3 deletions(-)
 create mode 100644 examples/resources/coderd_license/resource.tf

diff --git a/examples/resources/coderd_license/resource.tf b/examples/resources/coderd_license/resource.tf
new file mode 100644
index 0000000..3a25e9c
--- /dev/null
+++ b/examples/resources/coderd_license/resource.tf
@@ -0,0 +1,7 @@
+resource "coderd_license" "license" {
+  license = "<…>"
+
+  lifecycle {
+    create_before_destroy = true
+  }
+}
diff --git a/internal/provider/license_resource.go b/internal/provider/license_resource.go
index 2dec235..5cb4778 100644
--- a/internal/provider/license_resource.go
+++ b/internal/provider/license_resource.go
@@ -39,9 +39,12 @@ func (r *LicenseResource) Metadata(ctx context.Context, req resource.MetadataReq
 
 func (r *LicenseResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) {
 	resp.Schema = schema.Schema{
-		MarkdownDescription: "A license for a Coder deployment.\n\nIt's recommended to create multiple instances of this " +
-			"resource when updating a license. Modifying an existing license will cause the resource to be replaced, " +
-			"which may result in a brief unlicensed period.\n\n" +
+		MarkdownDescription: "A license for a Coder deployment.\n\nIt's recommended to set " +
+			"[`create_before_destroy`](https://developer.hashicorp.com/terraform/language/meta-arguments/lifecycle#create_before_destroy) " +
+			"on license resources. Without setting this, Terraform will remove the old " +
+			"license before adding the updated license. This will result in a temporary " +
+			"disruption to your users; during which they may be unable to use features " +
+			"that require a license.\n\n" +
 			"Terraform does not guarantee this resource " +
 			"will be created before other resources or attributes that require a licensed deployment. " +
 			"The `depends_on` meta-argument is instead recommended.",

From c3ba8464415360d6e61b580c111a3c9d150b7837 Mon Sep 17 00:00:00 2001
From: McKayla Washburn <mckayla@hey.com>
Date: Wed, 13 Nov 2024 17:20:34 +0000
Subject: [PATCH 2/2] gen

---
 docs/resources/license.md | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/docs/resources/license.md b/docs/resources/license.md
index 58c773c..ec29706 100644
--- a/docs/resources/license.md
+++ b/docs/resources/license.md
@@ -4,7 +4,7 @@ page_title: "coderd_license Resource - terraform-provider-coderd"
 subcategory: ""
 description: |-
   A license for a Coder deployment.
-  It's recommended to create multiple instances of this resource when updating a license. Modifying an existing license will cause the resource to be replaced, which may result in a brief unlicensed period.
+  It's recommended to set create_before_destroy https://developer.hashicorp.com/terraform/language/meta-arguments/lifecycle#create_before_destroy on license resources. Without setting this, Terraform will remove the old license before adding the updated license. This will result in a temporary disruption to your users; during which they may be unable to use features that require a license.
   Terraform does not guarantee this resource will be created before other resources or attributes that require a licensed deployment. The depends_on meta-argument is instead recommended.
 ---
 
@@ -12,11 +12,21 @@ description: |-
 
 A license for a Coder deployment.
 
-It's recommended to create multiple instances of this resource when updating a license. Modifying an existing license will cause the resource to be replaced, which may result in a brief unlicensed period.
+It's recommended to set [`create_before_destroy`](https://developer.hashicorp.com/terraform/language/meta-arguments/lifecycle#create_before_destroy) on license resources. Without setting this, Terraform will remove the old license before adding the updated license. This will result in a temporary disruption to your users; during which they may be unable to use features that require a license.
 
 Terraform does not guarantee this resource will be created before other resources or attributes that require a licensed deployment. The `depends_on` meta-argument is instead recommended.
 
+## Example Usage
 
+```terraform
+resource "coderd_license" "license" {
+  license = "<…>"
+
+  lifecycle {
+    create_before_destroy = true
+  }
+}
+```
 
 <!-- schema generated by tfplugindocs -->
 ## Schema