Skip to content

Commit d25df48

Browse files
committed
remove import support, add example
1 parent ea4aaf7 commit d25df48

File tree

3 files changed

+26
-8
lines changed

3 files changed

+26
-8
lines changed

docs/resources/organization_sync_settings.md

+15-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,21 @@ This resource can only be created once. Attempts to create multiple will fail.
1818
~> **Warning**
1919
This resource is only compatible with Coder version [2.19.0](https://github.com/coder/coder/releases/tag/v2.19.0) and later.
2020

21-
21+
## Example Usage
22+
23+
```terraform
24+
// Important note: You can only have one resource of this type!
25+
resource "coderd_organization_sync_settings" "org_sync" {
26+
field = "wibble"
27+
assign_default = false
28+
29+
mapping = {
30+
wobble = [
31+
coderd_organization.my_organization.id,
32+
]
33+
}
34+
}
35+
```
2236

2337
<!-- schema generated by tfplugindocs -->
2438
## Schema
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Important note: You can only have one resource of this type!
2+
resource "coderd_organization_sync_settings" "org_sync" {
3+
field = "wibble"
4+
assign_default = false
5+
6+
mapping = {
7+
wobble = [
8+
coderd_organization.my_organization.id,
9+
]
10+
}
11+
}

internal/provider/organization_sync_settings_resource.go

-7
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
"github.com/google/uuid"
99
"github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator"
1010
"github.com/hashicorp/terraform-plugin-framework/diag"
11-
"github.com/hashicorp/terraform-plugin-framework/path"
1211
"github.com/hashicorp/terraform-plugin-framework/resource"
1312
"github.com/hashicorp/terraform-plugin-framework/resource/schema"
1413
"github.com/hashicorp/terraform-plugin-framework/schema/validator"
@@ -18,7 +17,6 @@ import (
1817

1918
// Ensure provider defined types fully satisfy framework interfaces.
2019
var _ resource.Resource = &OrganizationSyncSettingsResource{}
21-
var _ resource.ResourceWithImportState = &OrganizationSyncSettingsResource{}
2220

2321
type OrganizationSyncSettingsResource struct {
2422
*CoderdProviderData
@@ -258,8 +256,3 @@ func (r *OrganizationSyncSettingsResource) Delete(ctx context.Context, req resou
258256
// Read Terraform prior state data into the model
259257
resp.Diagnostics.Append(req.State.Get(ctx, &data)...)
260258
}
261-
262-
func (r *OrganizationSyncSettingsResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) {
263-
// Any random string provided as the ID will work for importing.
264-
resource.ImportStatePassthroughID(ctx, path.Root("field"), req, resp)
265-
}

0 commit comments

Comments
 (0)