diff --git a/docs/data-sources/organizational_unit.md b/docs/data-sources/organizational_unit.md index 1b3f8537a..16b1baba7 100644 --- a/docs/data-sources/organizational_unit.md +++ b/docs/data-sources/organizational_unit.md @@ -3,19 +3,19 @@ page_title: "aiven_organizational_unit Data Source - terraform-provider-aiven" subcategory: "" description: |- - The Organizational Unit data source provides information about the existing Aiven Organizational Unit. + Gets information about an organizational unit. --- # aiven_organizational_unit (Data Source) -The Organizational Unit data source provides information about the existing Aiven Organizational Unit. +Gets information about an organizational unit. ## Example Usage ```terraform -data "aiven_organizational_unit" "organizational_unit1" { - name = "" - parent_id = "" +data "aiven_organizational_unit" "example_unit" { + name = "Example organizational unit" + parent_id = aiven_organization.main.id } ``` @@ -24,12 +24,12 @@ data "aiven_organizational_unit" "organizational_unit1" { ### Required -- `name` (String) Organizational Unit name +- `name` (String) The name of the organizational unit. ### Read-Only -- `create_time` (String) Time of creation +- `create_time` (String) Time of creation. - `id` (String) The ID of this resource. -- `parent_id` (String) Parent ID -- `tenant_id` (String) Tenant ID -- `update_time` (String) Time of last update +- `parent_id` (String) The ID of the organization that the unit is created in. +- `tenant_id` (String) Tenant ID. +- `update_time` (String) Time of last update. diff --git a/docs/resources/organizational_unit.md b/docs/resources/organizational_unit.md index db8521bdc..0c520ff1a 100644 --- a/docs/resources/organizational_unit.md +++ b/docs/resources/organizational_unit.md @@ -3,19 +3,19 @@ page_title: "aiven_organizational_unit Resource - terraform-provider-aiven" subcategory: "" description: |- - The Organizational Unit resource allows the creation and management of Aiven Organizational Units. + Creates and manages an organizational unit https://aiven.io/docs/platform/concepts/projects_accounts_access in an Aiven organization. --- # aiven_organizational_unit (Resource) -The Organizational Unit resource allows the creation and management of Aiven Organizational Units. +Creates and manages an [organizational unit](https://aiven.io/docs/platform/concepts/projects_accounts_access) in an Aiven organization. ## Example Usage ```terraform -resource "aiven_organizational_unit" "organizational_unit1" { - name = "" - parent_id = "" +resource "aiven_organizational_unit" "example_unit" { + name = "Example organizational unit" + parent_id = aiven_organization.main.id } ``` @@ -24,8 +24,8 @@ resource "aiven_organizational_unit" "organizational_unit1" { ### Required -- `name` (String) Organizational Unit name -- `parent_id` (String) Parent ID +- `name` (String) The name of the organizational unit. +- `parent_id` (String) The ID of the organization that the unit is created in. ### Optional @@ -33,10 +33,10 @@ resource "aiven_organizational_unit" "organizational_unit1" { ### Read-Only -- `create_time` (String) Time of creation +- `create_time` (String) Time of creation. - `id` (String) The ID of this resource. -- `tenant_id` (String) Tenant ID -- `update_time` (String) Time of last update +- `tenant_id` (String) Tenant ID. +- `update_time` (String) Time of last update. ### Nested Schema for `timeouts` @@ -54,5 +54,5 @@ Optional: Import is supported using the following syntax: ```shell -terraform import aiven_organizational_unit.organizational_unit1 organizational_unit_id +terraform import aiven_organizational_unit.example_unit ORGANIZATIONAL_UNIT_ID ``` diff --git a/examples/data-sources/aiven_organizational_unit/data-source.tf b/examples/data-sources/aiven_organizational_unit/data-source.tf index c20389865..ba7083524 100644 --- a/examples/data-sources/aiven_organizational_unit/data-source.tf +++ b/examples/data-sources/aiven_organizational_unit/data-source.tf @@ -1,4 +1,4 @@ -data "aiven_organizational_unit" "organizational_unit1" { - name = "" - parent_id = "" +data "aiven_organizational_unit" "example_unit" { + name = "Example organizational unit" + parent_id = aiven_organization.main.id } \ No newline at end of file diff --git a/examples/resources/aiven_organizational_unit/import.sh b/examples/resources/aiven_organizational_unit/import.sh index 040caf1ac..aafcded46 100644 --- a/examples/resources/aiven_organizational_unit/import.sh +++ b/examples/resources/aiven_organizational_unit/import.sh @@ -1 +1 @@ -terraform import aiven_organizational_unit.organizational_unit1 organizational_unit_id +terraform import aiven_organizational_unit.example_unit ORGANIZATIONAL_UNIT_ID diff --git a/examples/resources/aiven_organizational_unit/resource.tf b/examples/resources/aiven_organizational_unit/resource.tf index f91bed041..424ce2d8f 100644 --- a/examples/resources/aiven_organizational_unit/resource.tf +++ b/examples/resources/aiven_organizational_unit/resource.tf @@ -1,4 +1,4 @@ -resource "aiven_organizational_unit" "organizational_unit1" { - name = "" - parent_id = "" +resource "aiven_organizational_unit" "example_unit" { + name = "Example organizational unit" + parent_id = aiven_organization.main.id } \ No newline at end of file diff --git a/internal/sdkprovider/service/organization/organizational_unit.go b/internal/sdkprovider/service/organization/organizational_unit.go index b0f78e9de..4b851c97a 100644 --- a/internal/sdkprovider/service/organization/organizational_unit.go +++ b/internal/sdkprovider/service/organization/organizational_unit.go @@ -14,34 +14,33 @@ var aivenOrganizationalUnitSchema = map[string]*schema.Schema{ "name": { Type: schema.TypeString, Required: true, - Description: "Organizational Unit name", + Description: "The name of the organizational unit.", }, "parent_id": { Type: schema.TypeString, Required: true, - Description: "Parent ID", + Description: "The ID of the organization that the unit is created in.", }, "tenant_id": { Type: schema.TypeString, Computed: true, - Description: "Tenant ID", + Description: "Tenant ID.", }, "create_time": { Type: schema.TypeString, Computed: true, - Description: "Time of creation", + Description: "Time of creation.", }, "update_time": { Type: schema.TypeString, Computed: true, - Description: "Time of last update", + Description: "Time of last update.", }, } func ResourceOrganizationalUnit() *schema.Resource { return &schema.Resource{ - Description: "The Organizational Unit resource allows the creation and management of Aiven Organizational " + - "Units.", + Description: "Creates and manages an [organizational unit](https://aiven.io/docs/platform/concepts/projects_accounts_access) in an Aiven organization.", CreateContext: resourceOrganizationalUnitCreate, ReadContext: resourceOrganizationalUnitRead, UpdateContext: resourceOrganizationalUnitUpdate, diff --git a/internal/sdkprovider/service/organization/organizational_unit_data_source.go b/internal/sdkprovider/service/organization/organizational_unit_data_source.go index 88c868551..9a6fab2ea 100644 --- a/internal/sdkprovider/service/organization/organizational_unit_data_source.go +++ b/internal/sdkprovider/service/organization/organizational_unit_data_source.go @@ -13,9 +13,8 @@ import ( func DatasourceOrganizationalUnit() *schema.Resource { return &schema.Resource{ ReadContext: datasourceOrganizationalUnitRead, - Description: "The Organizational Unit data source provides information about the existing Aiven " + - "Organizational Unit.", - Schema: schemautil.ResourceSchemaAsDatasourceSchema(aivenOrganizationalUnitSchema, "name"), + Description: "Gets information about an organizational unit.", + Schema: schemautil.ResourceSchemaAsDatasourceSchema(aivenOrganizationalUnitSchema, "name"), } }