Skip to content

Commit

Permalink
docs: udpate org resource
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanndickson committed Dec 4, 2024
1 parent 283e3cc commit c8018b7
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The provider currently supports resources and data sources for:
- Templates + Template Versions
- Groups
- Workspace Proxies
- Organizations (Data Source only)
- Organizations

## Requirements

Expand Down
26 changes: 20 additions & 6 deletions docs/resources/organization.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,17 @@
page_title: "coderd_organization Resource - terraform-provider-coderd"
subcategory: ""
description: |-
An organization on the Coder deployment
An organization on the Coder deployment.
~> Warning
This resource is only compatible with Coder version 2.16.0 https://github.com/coder/coder/releases/tag/v2.16.0 and later.
---

# coderd_organization (Resource)

An organization on the Coder deployment
An organization on the Coder deployment.

~> **Warning**
This resource is only compatible with Coder version [2.16.0](https://github.com/coder/coder/releases/tag/v2.16.0) and later.



Expand All @@ -23,9 +28,9 @@ An organization on the Coder deployment

- `description` (String)
- `display_name` (String) Display name of the organization. Defaults to name.
- `group_sync` (Block, Optional) (see [below for nested schema](#nestedblock--group_sync))
- `group_sync` (Block, Optional) Group sync settings to sync groups from an IdP. (see [below for nested schema](#nestedblock--group_sync))
- `icon` (String)
- `role_sync` (Block, Optional) (see [below for nested schema](#nestedblock--role_sync))
- `role_sync` (Block, Optional) Role sync settings to sync organization roles from an IdP. (see [below for nested schema](#nestedblock--role_sync))

### Read-Only

Expand Down Expand Up @@ -55,6 +60,15 @@ Optional:
Import is supported using the following syntax:

```shell
# Organizations can be imported by their name
terraform import coderd_organization.our_org our_org
# The ID supplied can be either a organization UUID retrieved via the API
# or the name of the organization.
$ terraform import coderd_organization.our_org our-org
```
Alternatively, in Terraform v1.5.0 and later, an [`import` block](https://developer.hashicorp.com/terraform/language/import) can be used:

```terraform
import {
to = coderd_organization.our_org
id = "our-org"
}
```
13 changes: 11 additions & 2 deletions examples/resources/coderd_organization/import.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,11 @@
# Organizations can be imported by their name
terraform import coderd_organization.our_org our_org
# The ID supplied can be either a organization UUID retrieved via the API
# or the name of the organization.
$ terraform import coderd_organization.our_org our-org
```
Alternatively, in Terraform v1.5.0 and later, an [`import` block](https://developer.hashicorp.com/terraform/language/import) can be used:
```terraform
import {
to = coderd_organization.our_org
id = "our-org"
}
7 changes: 6 additions & 1 deletion internal/provider/organization_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,11 @@ func (r *OrganizationResource) Metadata(ctx context.Context, req resource.Metada

func (r *OrganizationResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) {
resp.Schema = schema.Schema{
MarkdownDescription: "An organization on the Coder deployment",
MarkdownDescription: `An organization on the Coder deployment.
~> **Warning**
This resource is only compatible with Coder version [2.16.0](https://github.com/coder/coder/releases/tag/v2.16.0) and later.
`,
Attributes: map[string]schema.Attribute{
"id": schema.StringAttribute{
CustomType: UUIDType,
Expand Down Expand Up @@ -135,6 +138,7 @@ func (r *OrganizationResource) Schema(ctx context.Context, req resource.SchemaRe

Blocks: map[string]schema.Block{
"group_sync": schema.SingleNestedBlock{
MarkdownDescription: `Group sync settings to sync groups from an IdP.`,
Attributes: map[string]schema.Attribute{
"field": schema.StringAttribute{
Optional: true,
Expand Down Expand Up @@ -167,6 +171,7 @@ func (r *OrganizationResource) Schema(ctx context.Context, req resource.SchemaRe
},
},
"role_sync": schema.SingleNestedBlock{
MarkdownDescription: `Role sync settings to sync organization roles from an IdP.`,
Attributes: map[string]schema.Attribute{
"field": schema.StringAttribute{
Optional: true,
Expand Down

0 comments on commit c8018b7

Please sign in to comment.