From d16ae8ba641bafc88d53908e428d70e5175754b2 Mon Sep 17 00:00:00 2001 From: BenjaminDecreusefond Date: Tue, 29 Oct 2024 17:03:16 +0100 Subject: [PATCH] fix: update docs (#86) * fix: update docs --- docs/resources/module.md | 6 +++--- docs/resources/organization.md | 4 ++-- docs/resources/organization_tag.md | 4 ++-- docs/resources/organization_template.md | 4 ++-- docs/resources/organization_variable.md | 10 +++++----- docs/resources/team.md | 4 ++-- docs/resources/team_token.md | 4 ++-- docs/resources/vcs.md | 4 ++-- docs/resources/workspace_cli.md | 6 +++--- docs/resources/workspace_schedule.md | 4 ++-- docs/resources/workspace_tag.md | 4 ++-- docs/resources/workspace_variable.md | 10 +++++----- docs/resources/workspace_vcs.md | 8 ++++---- docs/resources/workspace_webhook.md | 6 +++--- examples/resources/terrakube_workspace_vcs/resource.tf | 2 +- internal/provider/module_resource.go | 5 ++++- internal/provider/organization_resource.go | 2 ++ internal/provider/organization_tag_resource.go | 2 ++ internal/provider/organization_template_resource.go | 3 +++ internal/provider/organization_variable_resource.go | 8 +++++--- internal/provider/team_resource.go | 2 ++ internal/provider/team_token_resource.go | 1 + internal/provider/vcs_resource.go | 3 +++ internal/provider/workspace_cli_resource.go | 6 +++++- internal/provider/workspace_schedule_resource.go | 2 ++ internal/provider/workspace_tag_resource.go | 2 ++ internal/provider/workspace_variable_resource.go | 8 +++++--- internal/provider/workspace_vcs_resource.go | 6 +++++- internal/provider/workspace_webhook_resource.go | 9 ++++++++- 29 files changed, 89 insertions(+), 50 deletions(-) diff --git a/docs/resources/module.md b/docs/resources/module.md index ad3cb16..171c863 100644 --- a/docs/resources/module.md +++ b/docs/resources/module.md @@ -3,12 +3,12 @@ page_title: "terrakube_module Resource - terrakube" subcategory: "" description: |- - + Resource for managing modules in Terrakube. This resource allows you to create, read, update, and delete modules within a specified organization. --- # terrakube_module (Resource) - +Resource for managing modules in Terrakube. This resource allows you to create, read, update, and delete modules within a specified organization. ## Example Usage @@ -49,7 +49,7 @@ resource "terrakube_module" "module" { - `name` (String) Module name - `organization_id` (String) Terrakube organization id - `provider_name` (String) Module provider name. Example: azurerm, google, aws, etc -- `source` (String) Source (git using https or ssh protocol) +- `source` (String) Source repository for the module(git using https or ssh protocol) ### Optional diff --git a/docs/resources/organization.md b/docs/resources/organization.md index 65c8554..bcc2bab 100644 --- a/docs/resources/organization.md +++ b/docs/resources/organization.md @@ -3,12 +3,12 @@ page_title: "terrakube_organization Resource - terrakube" subcategory: "" description: |- - + Creates an Organization on Terrakube instance. --- # terrakube_organization (Resource) - +Creates an Organization on Terrakube instance. ## Example Usage diff --git a/docs/resources/organization_tag.md b/docs/resources/organization_tag.md index 92b8c82..27f3fc4 100644 --- a/docs/resources/organization_tag.md +++ b/docs/resources/organization_tag.md @@ -3,12 +3,12 @@ page_title: "terrakube_organization_tag Resource - terrakube" subcategory: "" description: |- - + Create a tag and attach it to your organization. --- # terrakube_organization_tag (Resource) - +Create a tag and attach it to your organization. ## Example Usage diff --git a/docs/resources/organization_template.md b/docs/resources/organization_template.md index 5e39a18..8214e43 100644 --- a/docs/resources/organization_template.md +++ b/docs/resources/organization_template.md @@ -3,12 +3,12 @@ page_title: "terrakube_organization_template Resource - terrakube" subcategory: "" description: |- - + Create a template and attach it to your organization. This can be useful to define newprocess like drift detection, cost mapping, etc... --- # terrakube_organization_template (Resource) - +Create a template and attach it to your organization. This can be useful to define newprocess like drift detection, cost mapping, etc... ## Example Usage diff --git a/docs/resources/organization_variable.md b/docs/resources/organization_variable.md index 0d910e3..22e4b02 100644 --- a/docs/resources/organization_variable.md +++ b/docs/resources/organization_variable.md @@ -3,12 +3,12 @@ page_title: "terrakube_organization_variable Resource - terrakube" subcategory: "" description: |- - + Create an organization variable that can be used by all workspaces inside the organization. --- # terrakube_organization_variable (Resource) - +Create an organization variable that can be used by all workspaces inside the organization. ## Example Usage @@ -39,12 +39,12 @@ resource "terrakube_organization_variable" "sample2" { ### Required -- `category` (String) Variable category (ENV or TERRAFORM) +- `category` (String) Variable category (ENV or TERRAFORM). ENV variables are injected in workspace environment at runtime. - `description` (String) Variable description -- `hcl` (Boolean) is hcl? +- `hcl` (Boolean) Parse this field as HashiCorp Configuration Language (HCL). This allows you to interpolate values at runtime. - `key` (String) Variable key - `organization_id` (String) Terrakube organization id -- `sensitive` (Boolean) is sensitive? +- `sensitive` (Boolean) Sensitive variables are never shown in the UI or API. They may appear in Terraform logs if your configuration is designed to output them. - `value` (String) Variable value ### Read-Only diff --git a/docs/resources/team.md b/docs/resources/team.md index 782bd09..bf8071e 100644 --- a/docs/resources/team.md +++ b/docs/resources/team.md @@ -3,12 +3,12 @@ page_title: "terrakube_team Resource - terrakube" subcategory: "" description: |- - + Create a team and bind it to an organization. Allows for fined grained access management. --- # terrakube_team (Resource) - +Create a team and bind it to an organization. Allows for fined grained access management. ## Example Usage diff --git a/docs/resources/team_token.md b/docs/resources/team_token.md index 8c5ef68..fade32d 100644 --- a/docs/resources/team_token.md +++ b/docs/resources/team_token.md @@ -3,12 +3,12 @@ page_title: "terrakube_team_token Resource - terrakube" subcategory: "" description: |- - + Create a team token that shares the same privilege. Useful when managing devs access. --- # terrakube_team_token (Resource) - +Create a team token that shares the same privilege. Useful when managing devs access. ## Example Usage diff --git a/docs/resources/vcs.md b/docs/resources/vcs.md index b55f104..4d811d0 100644 --- a/docs/resources/vcs.md +++ b/docs/resources/vcs.md @@ -3,12 +3,12 @@ page_title: "terrakube_vcs Resource - terrakube" subcategory: "" description: |- - + Create a VCS provider for the desired organization. VCS are used by VCS workspace to read github repositories at run time. --- # terrakube_vcs (Resource) - +Create a VCS provider for the desired organization. VCS are used by VCS workspace to read github repositories at run time. ## Example Usage diff --git a/docs/resources/workspace_cli.md b/docs/resources/workspace_cli.md index 7f1b878..9b579ba 100644 --- a/docs/resources/workspace_cli.md +++ b/docs/resources/workspace_cli.md @@ -3,12 +3,12 @@ page_title: "terrakube_workspace_cli Resource - terrakube" subcategory: "" description: |- - + Create a CLI workspace for Terrakube. When running plan from UI with CLI workspace only the current state will be compared to the cloud provider API not taking into account the file containedin workspace working directory. If you want to fetch files from github use vcs_workspace instead. --- # terrakube_workspace_cli (Resource) - +Create a CLI workspace for Terrakube. When running plan from UI with CLI workspace only the current state will be compared to the cloud provider API not taking into account the file containedin workspace working directory. If you want to fetch files from github use vcs_workspace instead. ## Example Usage @@ -38,7 +38,7 @@ resource "terrakube_workspace_cli" "sample2" { ### Required - `description` (String) Workspace CLI description -- `execution_mode` (String) Workspace CLI execution mode (remote or local) +- `execution_mode` (String) Workspace CLI execution mode (remote or local). Remote execution will require setting up executor. - `iac_type` (String) Workspace CLI IaC type (Supported values terraform or tofu) - `iac_version` (String) Workspace CLI IaC type - `name` (String) Workspace CLI name diff --git a/docs/resources/workspace_schedule.md b/docs/resources/workspace_schedule.md index 0cbc795..c19d3f9 100644 --- a/docs/resources/workspace_schedule.md +++ b/docs/resources/workspace_schedule.md @@ -3,12 +3,12 @@ page_title: "terrakube_workspace_schedule Resource - terrakube" subcategory: "" description: |- - + Create a workspace schedule that will allow you to run templates on a regular basis. --- # terrakube_workspace_schedule (Resource) - +Create a workspace schedule that will allow you to run templates on a regular basis. diff --git a/docs/resources/workspace_tag.md b/docs/resources/workspace_tag.md index 1d6c0ee..b604998 100644 --- a/docs/resources/workspace_tag.md +++ b/docs/resources/workspace_tag.md @@ -3,12 +3,12 @@ page_title: "terrakube_workspace_tag Resource - terrakube" subcategory: "" description: |- - + Adds a tag to a workspace resource. --- # terrakube_workspace_tag (Resource) - +Adds a tag to a workspace resource. ## Example Usage diff --git a/docs/resources/workspace_variable.md b/docs/resources/workspace_variable.md index 77877d2..626f611 100644 --- a/docs/resources/workspace_variable.md +++ b/docs/resources/workspace_variable.md @@ -3,12 +3,12 @@ page_title: "terrakube_workspace_variable Resource - terrakube" subcategory: "" description: |- - + Create variables that will be used by this workspace only. --- # terrakube_workspace_variable (Resource) - +Create variables that will be used by this workspace only. ## Example Usage @@ -41,12 +41,12 @@ resource "terrakube_workspace_variable" "sample2" { ### Required -- `category` (String) Variable category (ENV or TERRAFORM) +- `category` (String) Variable category (ENV or TERRAFORM). ENV variables are injected in workspace environment at runtime. - `description` (String) Variable description -- `hcl` (Boolean) is hcl? +- `hcl` (Boolean) Parse this field as HashiCorp Configuration Language (HCL). This allows you to interpolate values at runtime. - `key` (String) Variable key - `organization_id` (String) Terrakube organization id -- `sensitive` (Boolean) is sensitive? +- `sensitive` (Boolean) Sensitive variables are never shown in the UI or API. They may appear in Terraform logs if your configuration is designed to output them. - `value` (String) Variable value - `workspace_id` (String) Terrakube workspace id diff --git a/docs/resources/workspace_vcs.md b/docs/resources/workspace_vcs.md index 71d2a3f..ccb049c 100644 --- a/docs/resources/workspace_vcs.md +++ b/docs/resources/workspace_vcs.md @@ -3,17 +3,17 @@ page_title: "terrakube_workspace_vcs Resource - terrakube" subcategory: "" description: |- - + Create a VCS workspace for Terrakube. When running plan from UI with VCS workspace it will compare files contained in github repository with the cloud provider. If you only want to compare state with cloud provider API use CLI workspace instead. --- # terrakube_workspace_vcs (Resource) - +Create a VCS workspace for Terrakube. When running plan from UI with VCS workspace it will compare files contained in github repository with the cloud provider. If you only want to compare state with cloud provider API use CLI workspace instead. ## Example Usage ```terraform -resource "terrakube_workspace_cli" "sample1" { +resource "terrakube_workspace_vcs" "sample1" { organization_id = data.terrakube_organization.org.id name = "work-from-provider1" description = "sample" @@ -37,6 +37,7 @@ resource "terrakube_workspace_cli" "sample1" { - `organization_id` (String) Terrakube organization id - `repository` (String) Workspace VCS repository - `template_id` (String) Default template ID for the workspace +- `vcs_id` (String) VCS connection ID for private workspaces ### Optional @@ -45,7 +46,6 @@ resource "terrakube_workspace_cli" "sample1" { - `execution_mode` (String) Workspace VCS execution mode (remote or local) - `folder` (String) Workspace VCS folder - `iac_type` (String) Workspace VCS IaC type (Supported values terraform or tofu) -- `vcs_id` (String) VCS connection ID for private workspaces ### Read-Only diff --git a/docs/resources/workspace_webhook.md b/docs/resources/workspace_webhook.md index 5774cd1..451e730 100644 --- a/docs/resources/workspace_webhook.md +++ b/docs/resources/workspace_webhook.md @@ -3,12 +3,12 @@ page_title: "terrakube_workspace_webhook Resource - terrakube" subcategory: "" description: |- - + Create a webhook attached to a workspace. Can be useful for automated apply/plan workflows. --- # terrakube_workspace_webhook (Resource) - +Create a webhook attached to a workspace. Can be useful for automated apply/plan workflows. ## Example Usage @@ -32,7 +32,7 @@ resource "terrakube_workspace_webhook" "webhook" { ### Optional -- `branch` (List of String) A list of branches that trigger a run. +- `branch` (List of String) A list of branches that trigger a run. Support regex for more complex matching. - `event` (String) The event type that triggers a run, currently only `PUSH` is supported. - `path` (List of String) The file paths in regex that trigger a run. - `remote_hook_id` (String) The remote hook ID. diff --git a/examples/resources/terrakube_workspace_vcs/resource.tf b/examples/resources/terrakube_workspace_vcs/resource.tf index 8bae2a9..26b756e 100644 --- a/examples/resources/terrakube_workspace_vcs/resource.tf +++ b/examples/resources/terrakube_workspace_vcs/resource.tf @@ -1,4 +1,4 @@ -resource "terrakube_workspace_cli" "sample1" { +resource "terrakube_workspace_vcs" "sample1" { organization_id = data.terrakube_organization.org.id name = "work-from-provider1" description = "sample" diff --git a/internal/provider/module_resource.go b/internal/provider/module_resource.go index 7ed3a15..79a943f 100644 --- a/internal/provider/module_resource.go +++ b/internal/provider/module_resource.go @@ -53,6 +53,9 @@ func (r *ModuleResource) Metadata(ctx context.Context, req resource.MetadataRequ func (r *ModuleResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { resp.Schema = schema.Schema{ + MarkdownDescription: "Resource for managing modules in Terrakube. " + + "This resource allows you to create, read, update, and delete modules within a specified organization.", + Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ Computed: true, @@ -79,7 +82,7 @@ func (r *ModuleResource) Schema(ctx context.Context, req resource.SchemaRequest, }, "source": schema.StringAttribute{ Required: true, - Description: "Source (git using https or ssh protocol)", + Description: "Source repository for the module(git using https or ssh protocol)", }, "vcs_id": schema.StringAttribute{ Optional: true, diff --git a/internal/provider/organization_resource.go b/internal/provider/organization_resource.go index cc92bb4..45957b1 100644 --- a/internal/provider/organization_resource.go +++ b/internal/provider/organization_resource.go @@ -49,6 +49,8 @@ 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: "Creates an Organization on Terrakube instance.", + Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ Computed: true, diff --git a/internal/provider/organization_tag_resource.go b/internal/provider/organization_tag_resource.go index 8102766..d50a466 100644 --- a/internal/provider/organization_tag_resource.go +++ b/internal/provider/organization_tag_resource.go @@ -47,6 +47,8 @@ func (r *OrganizationTagResource) Metadata(ctx context.Context, req resource.Met func (r *OrganizationTagResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { resp.Schema = schema.Schema{ + MarkdownDescription: "Create a tag and attach it to your organization.", + Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ Computed: true, diff --git a/internal/provider/organization_template_resource.go b/internal/provider/organization_template_resource.go index 98c0924..42dfeed 100644 --- a/internal/provider/organization_template_resource.go +++ b/internal/provider/organization_template_resource.go @@ -52,6 +52,9 @@ func (r *OrganizationTemplateResource) Metadata(ctx context.Context, req resourc func (r *OrganizationTemplateResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { resp.Schema = schema.Schema{ + MarkdownDescription: "Create a template and attach it to your organization. This can be useful to define new" + + "process like drift detection, cost mapping, etc...", + Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ Computed: true, diff --git a/internal/provider/organization_variable_resource.go b/internal/provider/organization_variable_resource.go index 1c48cf4..5d4c0ba 100644 --- a/internal/provider/organization_variable_resource.go +++ b/internal/provider/organization_variable_resource.go @@ -53,6 +53,8 @@ func (r *OrganizationVariableResource) Metadata(ctx context.Context, req resourc func (r *OrganizationVariableResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { resp.Schema = schema.Schema{ + MarkdownDescription: "Create an organization variable that can be used by all workspaces inside the organization.", + Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ Computed: true, @@ -79,15 +81,15 @@ func (r *OrganizationVariableResource) Schema(ctx context.Context, req resource. }, "category": schema.StringAttribute{ Required: true, - Description: "Variable category (ENV or TERRAFORM)", + Description: "Variable category (ENV or TERRAFORM). ENV variables are injected in workspace environment at runtime.", }, "sensitive": schema.BoolAttribute{ Required: true, - Description: "is sensitive?", + Description: "Sensitive variables are never shown in the UI or API. They may appear in Terraform logs if your configuration is designed to output them.", }, "hcl": schema.BoolAttribute{ Required: true, - Description: "is hcl?", + Description: "Parse this field as HashiCorp Configuration Language (HCL). This allows you to interpolate values at runtime.", }, }, } diff --git a/internal/provider/team_resource.go b/internal/provider/team_resource.go index 1464d5c..4e7ce39 100644 --- a/internal/provider/team_resource.go +++ b/internal/provider/team_resource.go @@ -54,6 +54,8 @@ func (r *TeamResource) Metadata(ctx context.Context, req resource.MetadataReques func (r *TeamResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { resp.Schema = schema.Schema{ + MarkdownDescription: "Create a team and bind it to an organization. Allows for fined grained access management.", + Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ Computed: true, diff --git a/internal/provider/team_token_resource.go b/internal/provider/team_token_resource.go index a76e957..9a3f7be 100644 --- a/internal/provider/team_token_resource.go +++ b/internal/provider/team_token_resource.go @@ -52,6 +52,7 @@ func (r *TeamTokenResource) Metadata(ctx context.Context, req resource.MetadataR func (r *TeamTokenResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { resp.Schema = schema.Schema{ + MarkdownDescription: "Create a team token that shares the same privilege. Useful when managing devs access.", Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ Computed: true, diff --git a/internal/provider/vcs_resource.go b/internal/provider/vcs_resource.go index e353f1c..6742157 100644 --- a/internal/provider/vcs_resource.go +++ b/internal/provider/vcs_resource.go @@ -62,6 +62,9 @@ func (r *VcsResource) Metadata(ctx context.Context, req resource.MetadataRequest func (r *VcsResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { resp.Schema = schema.Schema{ + MarkdownDescription: "Create a VCS provider for the desired organization. VCS are used by VCS workspace to read " + + "github repositories at run time.", + Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ Computed: true, diff --git a/internal/provider/workspace_cli_resource.go b/internal/provider/workspace_cli_resource.go index 5b25d40..4982ffe 100644 --- a/internal/provider/workspace_cli_resource.go +++ b/internal/provider/workspace_cli_resource.go @@ -52,6 +52,10 @@ func (r *WorkspaceCliResource) Metadata(ctx context.Context, req resource.Metada func (r *WorkspaceCliResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { resp.Schema = schema.Schema{ + MarkdownDescription: "Create a CLI workspace for Terrakube. When running plan from UI with CLI workspace " + + "only the current state will be compared to the cloud provider API not taking into account the file contained" + + "in workspace working directory. If you want to fetch files from github use vcs_workspace instead.", + Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ Computed: true, @@ -74,7 +78,7 @@ func (r *WorkspaceCliResource) Schema(ctx context.Context, req resource.SchemaRe }, "execution_mode": schema.StringAttribute{ Required: true, - Description: "Workspace CLI execution mode (remote or local)", + Description: "Workspace CLI execution mode (remote or local). Remote execution will require setting up executor.", }, "iac_type": schema.StringAttribute{ Required: true, diff --git a/internal/provider/workspace_schedule_resource.go b/internal/provider/workspace_schedule_resource.go index adf79aa..6d7e46d 100644 --- a/internal/provider/workspace_schedule_resource.go +++ b/internal/provider/workspace_schedule_resource.go @@ -48,6 +48,8 @@ func (r *WorkspaceScheduleResource) Metadata(ctx context.Context, req resource.M func (r *WorkspaceScheduleResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { resp.Schema = schema.Schema{ + MarkdownDescription: "Create a workspace schedule that will allow you to run templates on a regular basis.", + Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ Computed: true, diff --git a/internal/provider/workspace_tag_resource.go b/internal/provider/workspace_tag_resource.go index 0dae20a..56783eb 100644 --- a/internal/provider/workspace_tag_resource.go +++ b/internal/provider/workspace_tag_resource.go @@ -47,6 +47,8 @@ func (r *WorkspaceTagResource) Metadata(ctx context.Context, req resource.Metada func (r *WorkspaceTagResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { resp.Schema = schema.Schema{ + MarkdownDescription: "Adds a tag to a workspace resource.", + Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ Computed: true, diff --git a/internal/provider/workspace_variable_resource.go b/internal/provider/workspace_variable_resource.go index ef6bfe5..3765d43 100644 --- a/internal/provider/workspace_variable_resource.go +++ b/internal/provider/workspace_variable_resource.go @@ -53,6 +53,8 @@ func (r *WorkspaceVariableResource) Metadata(ctx context.Context, req resource.M func (r *WorkspaceVariableResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { resp.Schema = schema.Schema{ + MarkdownDescription: "Create variables that will be used by this workspace only.", + Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ Computed: true, @@ -83,15 +85,15 @@ func (r *WorkspaceVariableResource) Schema(ctx context.Context, req resource.Sch }, "category": schema.StringAttribute{ Required: true, - Description: "Variable category (ENV or TERRAFORM)", + Description: "Variable category (ENV or TERRAFORM). ENV variables are injected in workspace environment at runtime.", }, "sensitive": schema.BoolAttribute{ Required: true, - Description: "is sensitive?", + Description: "Sensitive variables are never shown in the UI or API. They may appear in Terraform logs if your configuration is designed to output them.", }, "hcl": schema.BoolAttribute{ Required: true, - Description: "is hcl?", + Description: "Parse this field as HashiCorp Configuration Language (HCL). This allows you to interpolate values at runtime.", }, }, } diff --git a/internal/provider/workspace_vcs_resource.go b/internal/provider/workspace_vcs_resource.go index a16cc58..5e00434 100644 --- a/internal/provider/workspace_vcs_resource.go +++ b/internal/provider/workspace_vcs_resource.go @@ -60,6 +60,10 @@ func (r *WorkspaceVcsResource) Metadata(ctx context.Context, req resource.Metada func (r *WorkspaceVcsResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { resp.Schema = schema.Schema{ + MarkdownDescription: "Create a VCS workspace for Terrakube. When running plan from UI with VCS workspace " + + "it will compare files contained in github repository with the cloud provider. If you only want to compare state " + + "with cloud provider API use CLI workspace instead.", + Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ Computed: true, @@ -123,7 +127,7 @@ func (r *WorkspaceVcsResource) Schema(ctx context.Context, req resource.SchemaRe Description: "Workspace VCS folder", }, "vcs_id": schema.StringAttribute{ - Optional: true, + Required: true, Description: "VCS connection ID for private workspaces", }, }, diff --git a/internal/provider/workspace_webhook_resource.go b/internal/provider/workspace_webhook_resource.go index 579e454..36f8ea8 100644 --- a/internal/provider/workspace_webhook_resource.go +++ b/internal/provider/workspace_webhook_resource.go @@ -55,7 +55,14 @@ func (r *WorkspaceWebhookResource) Metadata(ctx context.Context, req resource.Me } func (r *WorkspaceWebhookResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { + resp.Diagnostics.AddWarning( + "WARNING", + "In its current implementation, Terrakube creates "+ + "one webhook for each instance of this resource and github has a default limitation of 20 webhooks per repository.", + ) resp.Schema = schema.Schema{ + MarkdownDescription: "Create a webhook attached to a workspace. Can be useful for automated apply/plan workflows.", + Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ Computed: true, @@ -79,7 +86,7 @@ func (r *WorkspaceWebhookResource) Schema(ctx context.Context, req resource.Sche }, "branch": schema.ListAttribute{ Optional: true, - Description: "A list of branches that trigger a run.", + Description: "A list of branches that trigger a run. Support regex for more complex matching.", ElementType: types.StringType, }, "template_id": schema.StringAttribute{