From 70a6a5f1447919a7951d03a2f7d722bbaf846922 Mon Sep 17 00:00:00 2001 From: Robert E Date: Fri, 19 Jul 2024 16:09:06 +1000 Subject: [PATCH] update docs --- README.md | 5 +++ docs/data-sources/tenants.md | 9 ------ docs/resources/tenant.md | 14 +------- docs/resources/tenant_project.md | 32 +++++++++++++++++++ ...ironment.go => resource_tenant project.go} | 2 +- templates/resources/tenant.md.tmpl | 14 ++++++++ 6 files changed, 53 insertions(+), 23 deletions(-) create mode 100644 docs/resources/tenant_project.md rename octopusdeploy/{resource_tenant project_environment.go => resource_tenant project.go} (97%) create mode 100644 templates/resources/tenant.md.tmpl diff --git a/README.md b/README.md index 26e436923..d00b67106 100644 --- a/README.md +++ b/README.md @@ -186,6 +186,11 @@ Documentation is auto-generated by the [tfplugindocs CLI](https://github.com/has $ make docs ``` +or +```shell +go generate main.go +``` + ## 🤝 Contributions Contributions are welcome! :heart: Please read our [Contributing Guide](CONTRIBUTING.md) for information about how to get involved in this project. diff --git a/docs/data-sources/tenants.md b/docs/data-sources/tenants.md index 46a4cf5aa..28d093d17 100644 --- a/docs/data-sources/tenants.md +++ b/docs/data-sources/tenants.md @@ -42,16 +42,7 @@ Read-Only: - `description` (String) The description of this tenant. - `id` (String) The unique ID for this resource. - `name` (String) The name of this resource. -- `project_environment` (Set of Object) (see [below for nested schema](#nestedatt--tenants--project_environment)) - `space_id` (String) The space ID associated with this resource. - `tenant_tags` (List of String) A list of tenant tags associated with this resource. - -### Nested Schema for `tenants.project_environment` - -Read-Only: - -- `environments` (List of String) -- `project_id` (String) - diff --git a/docs/resources/tenant.md b/docs/resources/tenant.md index 60a2793f8..ba3ce6aa6 100644 --- a/docs/resources/tenant.md +++ b/docs/resources/tenant.md @@ -1,5 +1,4 @@ --- -# generated by https://github.com/hashicorp/terraform-plugin-docs page_title: "octopusdeploy_tenant Resource - terraform-provider-octopusdeploy" subcategory: "" description: |- @@ -10,8 +9,6 @@ description: |- This resource manages tenants in Octopus Deploy. - - ## Schema @@ -24,16 +21,7 @@ This resource manages tenants in Octopus Deploy. - `cloned_from_tenant_id` (String) The ID of the tenant from which this tenant was cloned. - `description` (String) The description of this tenant. - `id` (String) The unique ID for this resource. -- `project_environment` (Block Set) (see [below for nested schema](#nestedblock--project_environment)) - `space_id` (String) The space ID associated with this resource. - `tenant_tags` (List of String) A list of tenant tags associated with this resource. - -### Nested Schema for `project_environment` - -Required: - -- `environments` (List of String) A list of environment IDs associated with this tenant through a project. -- `project_id` (String) The project ID associated with this tenant. - - +~> **NOTE property `project_environment` deprecated:** The `project_environment` property has been replaced by the `octopusdeploy_tenant_project` resource to allow more advanced provisioning scenarioes. \ No newline at end of file diff --git a/docs/resources/tenant_project.md b/docs/resources/tenant_project.md new file mode 100644 index 000000000..f537e8fcc --- /dev/null +++ b/docs/resources/tenant_project.md @@ -0,0 +1,32 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "octopusdeploy_tenant_project Resource - terraform-provider-octopusdeploy" +subcategory: "" +description: |- + This resource represents the connection between tenants and projects. +--- + +# octopusdeploy_tenant_project (Resource) + +This resource represents the connection between tenants and projects. + + + + +## Schema + +### Required + +- `project_id` (String) The project ID associated with this tenant. +- `tenant_id` (String) The tenant ID associated with this tenant. + +### Optional + +- `environment_ids` (List of String) The environment ID associated with this tenant. +- `space_id` (String) The space ID associated with this resource. + +### Read-Only + +- `id` (String) The ID of this resource. + + diff --git a/octopusdeploy/resource_tenant project_environment.go b/octopusdeploy/resource_tenant project.go similarity index 97% rename from octopusdeploy/resource_tenant project_environment.go rename to octopusdeploy/resource_tenant project.go index 2650b3088..b04d2f6c6 100644 --- a/octopusdeploy/resource_tenant project_environment.go +++ b/octopusdeploy/resource_tenant project.go @@ -17,7 +17,7 @@ func resourceTenantProject() *schema.Resource { return &schema.Resource{ CreateContext: resourceTenantProjectCreate, DeleteContext: resourceTenantProjectDelete, - Description: "This resource manages tenants in Octopus Deploy.", + Description: "This resource represents the connection between tenants and projects.", Importer: getImporter(), ReadContext: resourceTenantProjectRead, UpdateContext: resourceTenantProjectUpdate, diff --git a/templates/resources/tenant.md.tmpl b/templates/resources/tenant.md.tmpl new file mode 100644 index 000000000..d144e1f7c --- /dev/null +++ b/templates/resources/tenant.md.tmpl @@ -0,0 +1,14 @@ +--- +page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" +subcategory: "" +description: |- +{{ .Description | plainmarkdown | trimspace | prefixlines " " }} +--- + +# {{.Name}} ({{.Type}}) + +{{ .Description | trimspace }} + +{{ .SchemaMarkdown | trimspace }} + +~> **NOTE property `project_environment` deprecated:** The `project_environment` property has been replaced by the `octopusdeploy_tenant_project` resource to allow more advanced provisioning scenarioes. \ No newline at end of file