From 866dfa96315379eb75858452a1c95cf234d7929c Mon Sep 17 00:00:00 2001 From: Yonatan Koren <10080107+korenyoni@users.noreply.github.com> Date: Mon, 29 Jan 2024 10:41:50 -0500 Subject: [PATCH] docs: Misc documentation fixes (#133) ## What * Misc doc fixes. ## Why ## Notes ## Checklist * [x] _I have read [CONTRIBUTING.md](https://github.com/codefresh-io/terraform-provider-codefresh/blob/master/CONTRIBUTING.md)._ * [x] _I have [allowed changes to my fork to be made](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork)._ * [x] _I have added tests, assuming new tests are warranted_. * [x] _I understand that the `/test` comment will be ignored by the CI trigger [unless it is made by a repo admin or collaborator](https://codefresh.io/docs/docs/pipelines/triggers/git-triggers/#support-for-building-pull-requests-from-forks)._ --- codefresh/resource_abac_rules.go | 12 ++++++------ codefresh/resource_account.go | 12 ++++++------ codefresh/resource_account_admins.go | 2 +- codefresh/resource_context.go | 2 +- codefresh/resource_permission.go | 8 ++++---- docs/resources/abac_rules.md | 18 +++++++++--------- docs/resources/account.md | 12 ++++++------ docs/resources/account_admins.md | 2 +- docs/resources/context.md | 15 ++++++++------- docs/resources/permission.md | 10 +++++----- templates/resources/abac_rules.md.tmpl | 4 ++-- templates/resources/context.md.tmpl | 11 ++++++----- 12 files changed, 55 insertions(+), 53 deletions(-) diff --git a/codefresh/resource_abac_rules.go b/codefresh/resource_abac_rules.go index ec7561e..8271e52 100644 --- a/codefresh/resource_abac_rules.go +++ b/codefresh/resource_abac_rules.go @@ -15,7 +15,7 @@ var validSetValues = []string{"REFRESH", "SYNC", "TERMINATE_SYNC", "VIEW_POD_LOG func resourceGitopsAbacRule() *schema.Resource { return &schema.Resource{ - Description: "Gitops Abac Rules are used to setup access control and allow to define which teams have access to which resources based on tags and attributes.", + Description: "Gitops ABAC Rules are used to setup access control and allow to define which teams have access to which resources based on tags and attributes.", Create: resourceGitopsAbacRuleCreate, Read: resourceGitopsAbacRuleRead, Update: resourceGitopsAbacRuleUpdate, @@ -32,7 +32,7 @@ func resourceGitopsAbacRule() *schema.Resource { }, "entity_type": { Description: ` -The type of resources the abac rules applies to. Possible values: +The type of resources the ABAC rules applies to. Possible values: * gitopsApplications `, Type: schema.TypeString, @@ -42,16 +42,16 @@ The type of resources the abac rules applies to. Possible values: }, false), }, "teams": { - Description: "The Ids of teams the abac rules apply to.", + Description: "The IDs of the teams the ABAC rules apply to.", Type: schema.TypeSet, Required: true, Elem: &schema.Schema{Type: schema.TypeString}, }, "tags": { Description: ` -The effective tags to apply the permission. It supports 2 custom tags: - * untagged is a “tag” which refers to all resources that don't have any tag. - * (the star character) means all tags. +The effective tags of the resource to apply the permission to. There are two special tags: + * untagged: Apply to all resources without tags. + * * (asterisk): Apply to all resources with any tag. `, Type: schema.TypeSet, Optional: true, diff --git a/codefresh/resource_account.go b/codefresh/resource_account.go index 0fbb7bf..fd19b9b 100644 --- a/codefresh/resource_account.go +++ b/codefresh/resource_account.go @@ -27,11 +27,11 @@ func resourceAccount() *schema.Resource { Description: ` Features toggles for this account. Default: -OfflineLogging: true -ssoManagement: true -teamsManagement: true -abac: true -customKubernetesCluster: true +* OfflineLogging: true +* ssoManagement: true +* teamsManagement: true +* abac: true +* customKubernetesCluster: true `, Type: schema.TypeMap, Optional: true, @@ -58,7 +58,7 @@ customKubernetesCluster: true Required: true, }, "data_retention_weeks": { - Description: "Specifies how long, in weeks, the builds be stored (default: `5`).", + Description: "Specifies the number of weeks for which to store the builds (default: `5`).", Type: schema.TypeInt, Optional: true, Default: 5, diff --git a/codefresh/resource_account_admins.go b/codefresh/resource_account_admins.go index 93b3937..b5c777e 100644 --- a/codefresh/resource_account_admins.go +++ b/codefresh/resource_account_admins.go @@ -20,7 +20,7 @@ func resourceAccountAdmins() *schema.Resource { }, Schema: map[string]*schema.Schema{ "account_id": { - Description: "The account id where to set up a list of admins.", + Description: "The account ID for which to set up the list of admins.", Type: schema.TypeString, Required: true, }, diff --git a/codefresh/resource_context.go b/codefresh/resource_context.go index bde0fc5..7e9556c 100644 --- a/codefresh/resource_context.go +++ b/codefresh/resource_context.go @@ -42,7 +42,7 @@ func getConflictingContexts(context string) []string { func resourceContext() *schema.Resource { return &schema.Resource{ - Description: "A Context is an authentication/configuration that is used by the Codefresh system and engine.", + Description: "A Context is an authentication/configuration resource used by the Codefresh system and engine.", Create: resourceContextCreate, Read: resourceContextRead, Update: resourceContextUpdate, diff --git a/codefresh/resource_permission.go b/codefresh/resource_permission.go index 9b7de69..1e9f137 100644 --- a/codefresh/resource_permission.go +++ b/codefresh/resource_permission.go @@ -14,7 +14,7 @@ import ( func resourcePermission() *schema.Resource { return &schema.Resource{ - Description: "Permission are used to setup access control and allow to define which teams have access to which clusters and pipelines based on tags.", + Description: "Permissions are used to set up access control and define which teams have access to which clusters and pipelines based on tags.", Create: resourcePermissionCreate, Read: resourcePermissionRead, Update: resourcePermissionUpdate, @@ -85,9 +85,9 @@ Action to be allowed. Possible values: }, "tags": { Description: ` -The effective tags to apply the permission. It supports 2 custom tags: - * untagged is a “tag” which refers to all clusters that don't have any tag. - * (the star character) means all tags. +The tags for which to apply the permission. Supports two custom tags: + * untagged: Apply to all resources without tags + * (asterisk): Apply to all resources with any tag `, Type: schema.TypeSet, Optional: true, diff --git a/docs/resources/abac_rules.md b/docs/resources/abac_rules.md index c7cdcb0..1aecdae 100644 --- a/docs/resources/abac_rules.md +++ b/docs/resources/abac_rules.md @@ -2,14 +2,14 @@ page_title: "codefresh_abac_rules Resource - terraform-provider-codefresh" subcategory: "" description: |- - Gitops Abac Rules are used to setup access control and allow to define which teams have access to which resources based on tags and attributes. + Gitops ABAC Rules are used to setup access control and allow to define which teams have access to which resources based on tags and attributes. --- # codefresh_abac_rules (Resource) -Gitops Abac Rules are used to setup access control and allow to define which teams have access to which resources based on tags and attributes. +Gitops ABAC Rules are used to setup access control and allow to define which teams have access to which resources based on tags and attributes. -See the [Access Control documentation](https://codefresh.io/docs/docs/administration/account-user-management/access-control/). +See the [GitOps Access Control documentation](https://codefresh.io/docs/docs/administration/account-user-management/gitops-abac/). ## Example usage @@ -48,17 +48,17 @@ resource "codefresh_abac_rules" "app_rule" { * TERMINATE_SYNC * VIEW_POD_LOGS * APP_ROLLBACK -- `entity_type` (String) The type of resources the abac rules applies to. Possible values: +- `entity_type` (String) The type of resources the ABAC rules applies to. Possible values: * gitopsApplications -- `teams` (Set of String) The Ids of teams the abac rules apply to. +- `teams` (Set of String) The IDs of the teams the ABAC rules apply to. ### Optional - `attribute` (Block List) Resource attribute that need to be validated (see [below for nested schema](#nestedblock--attribute)) - `id` (String) The abac rule ID. -- `tags` (Set of String) The effective tags to apply the permission. It supports 2 custom tags: - * untagged is a “tag” which refers to all resources that don't have any tag. - * (the star character) means all tags. +- `tags` (Set of String) The effective tags of the resource to apply the permission to. There are two special tags: + * untagged: Apply to all resources without tags. + * * (asterisk): Apply to all resources with any tag. ### Nested Schema for `attribute` @@ -70,4 +70,4 @@ Required: Optional: -- `key` (String) \ No newline at end of file +- `key` (String) diff --git a/docs/resources/account.md b/docs/resources/account.md index e0e27da..0bbc685 100644 --- a/docs/resources/account.md +++ b/docs/resources/account.md @@ -49,11 +49,11 @@ resource "codefresh_account" "test" { - `build` (Block List) Build limits for this account. (see [below for nested schema](#nestedblock--build)) - `features` (Map of Boolean) Features toggles for this account. Default: -OfflineLogging: true -ssoManagement: true -teamsManagement: true -abac: true -customKubernetesCluster: true +* OfflineLogging: true +* ssoManagement: true +* teamsManagement: true +* abac: true +* customKubernetesCluster: true - `limits` (Block List) Limits for this account. (see [below for nested schema](#nestedblock--limits)) ### Read-Only @@ -81,7 +81,7 @@ Required: Optional: -- `data_retention_weeks` (Number) Specifies how long, in weeks, the builds be stored (default: `5`). +- `data_retention_weeks` (Number) Specifies the number of weeks for which to store the builds (default: `5`). ## Import ```sh diff --git a/docs/resources/account_admins.md b/docs/resources/account_admins.md index 4fd0910..207adca 100644 --- a/docs/resources/account_admins.md +++ b/docs/resources/account_admins.md @@ -61,7 +61,7 @@ resource "codefresh_account_admins" "test" { ### Required -- `account_id` (String) The account id where to set up a list of admins. +- `account_id` (String) The account ID for which to set up the list of admins. - `users` (Set of String) A list of users to set up as account admins. ### Read-Only diff --git a/docs/resources/context.md b/docs/resources/context.md index 9fb4b29..3a5a6cc 100644 --- a/docs/resources/context.md +++ b/docs/resources/context.md @@ -2,21 +2,22 @@ page_title: "codefresh_context Resource - terraform-provider-codefresh" subcategory: "" description: |- - A Context is an authentication/configuration that is used by the Codefresh system and engine. + A Context is an authentication/configuration resource used by the Codefresh system and engine. --- # codefresh_context (Resource) -A Context is an authentication/configuration that is used by the Codefresh system and engine. +A Context is an authentication/configuration resource used by the Codefresh system and engine. ## Supported types -There are multiple types of context available in Codefresh but they all have the following main components to define them: +Codefresh supports multiple types of Contexts, all of which share the following components: * `Name`: A unique identifier for the context * `Type`: A string representing the type of context -* `Data`: A data structure that provide the information related to the Context. This differs based on the type of context selected -For more details of the Context spec see in the [CLI official documentation](https://codefresh-io.github.io/cli/contexts/spec/) +* `Data`: A data structure that provides the information related to the Context. This differs based on the type of Context selected. + +For more details of the Context spec, please refer to the [official Codefresh CLI documentation](https://codefresh-io.github.io/cli/contexts/spec/) Currently the provider supports the following types of Context: @@ -26,7 +27,7 @@ Currently the provider supports the following types of Context: * `secret-yaml` (Secret YAML Configuration Context) ### Shared Configuration -A Shared Configuration is the entity in Codefresh that allow to create values in a central place that can then be consumed in pipelines to keep them DRY. +A Shared Configuration is the entity in Codefresh where you can create values in a centralized location, and then consume in pipelines to keep them [DRY](https://en.wikipedia.org/wiki/Don%27t_repeat_yourself). More details in the official [Shared Configuration documentation](https://codefresh.io/docs/docs/configure-ci-cd-pipeline/shared-configuration/) ### Example Usage @@ -225,4 +226,4 @@ Required: Required: -- `data` (String) The YAML string representing the shared config. \ No newline at end of file +- `data` (String) The YAML string representing the shared config. diff --git a/docs/resources/permission.md b/docs/resources/permission.md index 338fefc..66fc786 100644 --- a/docs/resources/permission.md +++ b/docs/resources/permission.md @@ -2,12 +2,12 @@ page_title: "codefresh_permission Resource - terraform-provider-codefresh" subcategory: "" description: |- - Permission are used to setup access control and allow to define which teams have access to which clusters and pipelines based on tags. + Permissions are used to set up access control and define which teams have access to which clusters and pipelines based on tags. --- # codefresh_permission (Resource) -Permission are used to setup access control and allow to define which teams have access to which clusters and pipelines based on tags. +Permissions are used to set up access control and define which teams have access to which clusters and pipelines based on tags. See the [Access Control documentation](https://codefresh.io/docs/docs/administration/account-user-management/access-control/). @@ -59,9 +59,9 @@ resource "codefresh_permission" "developers" { - `_id` (String) The permission ID. - `related_resource` (String) Specifies the resource to use when evaluating the tags. Possible values: * project -- `tags` (Set of String) The effective tags to apply the permission. It supports 2 custom tags: - * untagged is a “tag” which refers to all clusters that don't have any tag. - * (the star character) means all tags. +- `tags` (Set of String) The tags for which to apply the permission. Supports two custom tags: + * untagged: Apply to all resources without tags + * (asterisk): Apply to all resources with any tag ### Read-Only diff --git a/templates/resources/abac_rules.md.tmpl b/templates/resources/abac_rules.md.tmpl index bbb4b9d..ec5beb8 100644 --- a/templates/resources/abac_rules.md.tmpl +++ b/templates/resources/abac_rules.md.tmpl @@ -9,7 +9,7 @@ description: |- {{ .Description | trimspace }} -See the [Access Control documentation](https://codefresh.io/docs/docs/administration/account-user-management/access-control/). +See the [GitOps Access Control documentation](https://codefresh.io/docs/docs/administration/account-user-management/gitops-abac/). ## Example usage @@ -37,4 +37,4 @@ resource "codefresh_abac_rules" "app_rule" { ``` -{{ .SchemaMarkdown | trimspace }} \ No newline at end of file +{{ .SchemaMarkdown | trimspace }} diff --git a/templates/resources/context.md.tmpl b/templates/resources/context.md.tmpl index c6f3325..baee294 100644 --- a/templates/resources/context.md.tmpl +++ b/templates/resources/context.md.tmpl @@ -11,12 +11,13 @@ description: |- ## Supported types -There are multiple types of context available in Codefresh but they all have the following main components to define them: +Codefresh supports multiple types of Contexts, all of which share the following components: * `Name`: A unique identifier for the context * `Type`: A string representing the type of context -* `Data`: A data structure that provide the information related to the Context. This differs based on the type of context selected -For more details of the Context spec see in the [CLI official documentation](https://codefresh-io.github.io/cli/contexts/spec/) +* `Data`: A data structure that provides the information related to the Context. This differs based on the type of Context selected. + +For more details of the Context spec, please refer to the [official Codefresh CLI documentation](https://codefresh-io.github.io/cli/contexts/spec/) Currently the provider supports the following types of Context: @@ -26,7 +27,7 @@ Currently the provider supports the following types of Context: * `secret-yaml` (Secret YAML Configuration Context) ### Shared Configuration -A Shared Configuration is the entity in Codefresh that allow to create values in a central place that can then be consumed in pipelines to keep them DRY. +A Shared Configuration is the entity in Codefresh where you can create values in a centralized location, and then consume in pipelines to keep them [DRY](https://en.wikipedia.org/wiki/Don%27t_repeat_yourself). More details in the official [Shared Configuration documentation](https://codefresh.io/docs/docs/configure-ci-cd-pipeline/shared-configuration/) ### Example Usage @@ -95,4 +96,4 @@ resource "codefresh_context" "test-secret-yaml" { } ``` -{{ .SchemaMarkdown | trimspace }} \ No newline at end of file +{{ .SchemaMarkdown | trimspace }}