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

Commit03a98cd

Browse files
authored
chore: improvecoderd_license docs (#140)
1 parentd3394fa commit03a98cd

File tree

3 files changed

+25
-5
lines changed

3 files changed

+25
-5
lines changed

‎docs/resources/license.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,29 @@ page_title: "coderd_license Resource - terraform-provider-coderd"
44
subcategory:""
55
description:|-
66
A license for a Coder deployment.
7-
It's recommended tocreate multiple instances ofthis resource when updating alicense. Modifying an existinglicensewillcause the resourcetobe replaced,which mayresult in a brief unlicensed period.
7+
It's recommended toset create_before_destroy https://developer.hashicorp.com/terraform/language/meta-arguments/lifecycle#create_before_destroy on license resources. Without settingthis, Terraform will remove the oldlicense before adding the updatedlicense. Thiswillresult in a temporary disruptiontoyour users; duringwhichtheymaybe unable to use features that require a license.
88
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.
99
---
1010

1111
#coderd_license (Resource)
1212

1313
A license for a Coder deployment.
1414

15-
It's recommended tocreate multiple instances ofthis resource when updating alicense. Modifying an existinglicensewillcause the resourcetobe replaced,which mayresult in a brief unlicensed period.
15+
It's recommended toset[`create_before_destroy`](https://developer.hashicorp.com/terraform/language/meta-arguments/lifecycle#create_before_destroy) on license resources. Without settingthis, Terraform will remove the oldlicense before adding the updatedlicense. Thiswillresult in a temporary disruptiontoyour users; duringwhichtheymaybe unable to use features that require a license.
1616

1717
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.
1818

19+
##Example Usage
1920

21+
```terraform
22+
resource "coderd_license" "license" {
23+
license = "<…>"
24+
25+
lifecycle {
26+
create_before_destroy = true
27+
}
28+
}
29+
```
2030

2131
<!-- schema generated by tfplugindocs-->
2232
##Schema
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
resource"coderd_license""license" {
2+
license="<…>"
3+
4+
lifecycle {
5+
create_before_destroy=true
6+
}
7+
}

‎internal/provider/license_resource.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,12 @@ func (r *LicenseResource) Metadata(ctx context.Context, req resource.MetadataReq
3939

4040
func (r*LicenseResource)Schema(ctx context.Context,req resource.SchemaRequest,resp*resource.SchemaResponse) {
4141
resp.Schema= schema.Schema{
42-
MarkdownDescription:"A license for a Coder deployment.\n\nIt's recommended to create multiple instances of this "+
43-
"resource when updating a license. Modifying an existing license will cause the resource to be replaced, "+
44-
"which may result in a brief unlicensed period.\n\n"+
42+
MarkdownDescription:"A license for a Coder deployment.\n\nIt's recommended to set "+
43+
"[`create_before_destroy`](https://developer.hashicorp.com/terraform/language/meta-arguments/lifecycle#create_before_destroy) "+
44+
"on license resources. Without setting this, Terraform will remove the old "+
45+
"license before adding the updated license. This will result in a temporary "+
46+
"disruption to your users; during which they may be unable to use features "+
47+
"that require a license.\n\n"+
4548
"Terraform does not guarantee this resource "+
4649
"will be created before other resources or attributes that require a licensed deployment. "+
4750
"The `depends_on` meta-argument is instead recommended.",

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp