Skip to content

docs: update org resource #151

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified by running the tests against a 2.16.0 image.




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
Loading