diff --git a/.github/workflows/tfplugindocs-check.yml b/.github/workflows/tfplugindocs-check.yml new file mode 100644 index 00000000..1f9f9531 --- /dev/null +++ b/.github/workflows/tfplugindocs-check.yml @@ -0,0 +1,36 @@ +name: tfplugindocs check + +on: + push: + branches: + - master + +jobs: + tfplugindocs_check: + name: tfplugindocs check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + - uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 + with: + go-version-file: tools/go.mod + - name: GOCACHE + run: | + echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV + - uses: actions/cache@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4.1.1 + continue-on-error: true + timeout-minutes: 2 + with: + path: ${{ env.GOCACHE }} + key: ${{ runner.os }}-GOCACHE-${{ hashFiles('go.sum') }}-${{ hashFiles('internal/**') }} + - uses: actions/cache@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4.1.1 + continue-on-error: true + timeout-minutes: 2 + with: + path: ~/go/pkg/mod + key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }} + - run: | + make tools + make docs + git add -N docs/ + git diff --exit-code diff --git a/.github/workflows/tfplugindocs-generate.yml b/.github/workflows/tfplugindocs-generate.yml new file mode 100644 index 00000000..2743f417 --- /dev/null +++ b/.github/workflows/tfplugindocs-generate.yml @@ -0,0 +1,48 @@ +name: tfplugindocs generate + +on: + pull_request: + paths: + - .github/workflows/tfplugindocs-check.yml + - Makefile + - docs/** + - examples/** + - templates/** + - sonarqube/** + +jobs: + tfplugindocs_generate: + name: tfplugindocs generate + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + with: + persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token + fetch-depth: 0 # otherwise, you will fail to push refs to dest repo + - uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 + with: + go-version-file: tools/go.mod + - name: GOCACHE + run: | + echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV + - uses: actions/cache@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4.1.1 + continue-on-error: true + timeout-minutes: 2 + with: + path: ${{ env.GOCACHE }} + key: ${{ runner.os }}-GOCACHE-${{ hashFiles('go.sum') }}-${{ hashFiles('internal/**') }} + - uses: actions/cache@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4.1.1 + continue-on-error: true + timeout-minutes: 2 + with: + path: ~/go/pkg/mod + key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }} + - run: | + make tools + make docs + - uses: actions-js/push@5a7cbd780d82c0c937b5977586e641b2fd94acc5 #v1.5 + name: Github commit and push + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + branch: ${{ github.head_ref }} + message: "[bot] docs: tfplugindocs generate" diff --git a/.gitignore b/.gitignore index ff5db650..409555ed 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,6 @@ coverage.txt # dist directory for local testingg dist/ .vscode/settings.json + +.DS_Store + diff --git a/Makefile b/Makefile index d05ce52e..5682135b 100644 --- a/Makefile +++ b/Makefile @@ -3,11 +3,18 @@ export TF_LOG=DEBUG SRC=$(shell find . -name '*.go') SONARQUBE_IMAGE?=sonarqube:latest SONARQUBE_START_SLEEP?=60 +GO_VER ?= go -.PHONY: all vet build test +.PHONY: all vet build test tools docs all: fmt vet build +tools: + cd tools && $(GO_VER) install github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs + +docs: + @tfplugindocs generate + build: go build -a -tags netgo -o terraform-provider-sonarqube diff --git a/README.md b/README.md index d774ea6d..22143c3f 100644 --- a/README.md +++ b/README.md @@ -11,15 +11,16 @@ Terraform provider for managing Sonarqube configuration This is a community provider and is not supported by Hashicorp. ## Installation + This provider has been published to the Terraform Registry at https://registry.terraform.io/providers/jdamata/sonarqube. Please visit the registry for documentation and installation instructions. ## Developing the Provider Working on this provider requires the following: -* [Terraform](https://www.terraform.io/downloads.html) -* [Go](http://www.golang.org) -* [Docker Engine](https://docs.docker.com/engine/install/) +- [Terraform](https://www.terraform.io/downloads.html) +- [Go](http://www.golang.org) +- [Docker Engine](https://docs.docker.com/engine/install/) You will also need to correctly setup a [GOPATH](http://golang.org/doc/code.html#GOPATH), as well as adding `${GOPATH}/bin` to your `$PATH`. @@ -31,6 +32,17 @@ In order to run the full suite of Acceptance tests, run `make -i testacc`. These $ make -i testacc ``` +## Generate documentation + +Documentation is generated using `tfplugindocs`. These are auto-generated when creating a PR to the project. + +If you wish to generate documentation locally to verify it's accuracy, run the following commands: + +```sh +$ make tools +$ make docs +``` + ## Debugging the Provider -See [debugging.md](docs/debugging.md) +See [debugging.md](debugging.md) diff --git a/docs/debugging.md b/debugging.md similarity index 99% rename from docs/debugging.md rename to debugging.md index 2059da21..d224d22f 100644 --- a/docs/debugging.md +++ b/debugging.md @@ -7,6 +7,7 @@ You can debug the provider using a tool similar to [delve](https://github.com/go ### Visual Studio Code Using [Visual Studio Code](https://code.visualstudio.com/) with the [Go extension](https://marketplace.visualstudio.com/items?itemName=golang.go) installed, you would add a configuration similar to this to your `launch.json` file: + ```json { "name": "Debug Terraform Provider", @@ -23,7 +24,9 @@ Using [Visual Studio Code](https://code.visualstudio.com/) with the [Go extensio "showLog": true } ``` + Start the process using this configuration and then follow the instructions provided in the debug console: + ```shell Provider started. To attach Terraform CLI, set the TF_REATTACH_PROVIDERS environment variable with the following: @@ -35,6 +38,7 @@ Provider started. To attach Terraform CLI, set the TF_REATTACH_PROVIDERS environ ### Delve CLI With the delve CLI you would start a delve debugging session: + ```shell dlv exec --accept-multiclient --continue --headless ./terraform-provider-example -- -debug ``` diff --git a/docs/data-sources/group.md b/docs/data-sources/group.md new file mode 100644 index 00000000..73c5f7a3 --- /dev/null +++ b/docs/data-sources/group.md @@ -0,0 +1,31 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "sonarqube_group Data Source - terraform-provider-sonarqube" +subcategory: "" +description: |- + Use this data source to get a Sonarqube Group resource +--- + +# sonarqube_group (Data Source) + +Use this data source to get a Sonarqube Group resource + +## Example Usage + +```terraform +data "sonarqube_group" "group" { + name = "terraform-test" +} +``` + + +## Schema + +### Required + +- `name` (String) The name of the group. + +### Read-Only + +- `description` (String) The group description. +- `id` (String) The ID of this resource. diff --git a/docs/data-sources/portfolio.md b/docs/data-sources/portfolio.md new file mode 100644 index 00000000..e323207d --- /dev/null +++ b/docs/data-sources/portfolio.md @@ -0,0 +1,38 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "sonarqube_portfolio Data Source - terraform-provider-sonarqube" +subcategory: "" +description: |- + Use this data source to get a Sonarqube portfolio resource +--- + +# sonarqube_portfolio (Data Source) + +Use this data source to get a Sonarqube portfolio resource + +## Example Usage + +```terraform +data "sonarqube_portfolio" "portfolio" { + key = "portfolio-key" +} +``` + + +## Schema + +### Required + +- `key` (String) The key of the portfolio + +### Read-Only + +- `branch` (String) Which branch is analyzed +- `description` (String) Description of the portfolio +- `id` (String) The ID of this resource. +- `name` (String) Name of the portfolio +- `qualifier` (String) `VW` (portfolios always have this qualifier) +- `regexp` (String) The regular expression used to populate the portfolio. Only active when `selection_mode` is `REGEXP` +- `selection_mode` (String) How the Portfolio is populated. Possible values are `NONE`, `MANUAL`, `TAGS`, `REGEXP` or `REST`. [See docs](https://docs.sonarqube.org/9.8/project-administration/managing-portfolios/#populating-portfolios) for how Portfolio population works +- `tags` (List of String) The list of tags used to populate the Portfolio. Only active when `selection_mode` is `TAGS` +- `visibility` (String) Portfolio visibility diff --git a/docs/data-sources/project.md b/docs/data-sources/project.md new file mode 100644 index 00000000..9bcef7b8 --- /dev/null +++ b/docs/data-sources/project.md @@ -0,0 +1,32 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "sonarqube_project Data Source - terraform-provider-sonarqube" +subcategory: "" +description: |- + Use this data source to get a Sonarqube project resource +--- + +# sonarqube_project (Data Source) + +Use this data source to get a Sonarqube project resource + +## Example Usage + +```terraform +data "sonarqube_project" "project" { + project = "projet-key-id" +} +``` + + +## Schema + +### Required + +- `project` (String) The project key of the project + +### Read-Only + +- `id` (String) The ID of this resource. +- `name` (String) Name of the project +- `visibility` (String) Project visibility diff --git a/docs/data-sources/qualitygate.md b/docs/data-sources/qualitygate.md new file mode 100644 index 00000000..d3d11330 --- /dev/null +++ b/docs/data-sources/qualitygate.md @@ -0,0 +1,43 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "sonarqube_qualitygate Data Source - terraform-provider-sonarqube" +subcategory: "" +description: |- + Use this data source to get a Sonarqube qualitygate resource +--- + +# sonarqube_qualitygate (Data Source) + +Use this data source to get a Sonarqube qualitygate resource + +## Example Usage + +```terraform +data "sonarqube_qualitygate" "main" { + name = "example" +} +``` + + +## Schema + +### Required + +- `name` (String) The name of the Quality Gate. + +### Read-Only + +- `condition` (List of Object) List of Quality Gate conditions. (see [below for nested schema](#nestedatt--condition)) +- `copy_from` (String) Origin of the Quality Gate +- `id` (String) The ID of this resource. +- `is_default` (Boolean) Quality Gate default. + + +### Nested Schema for `condition` + +Read-Only: + +- `id` (String) +- `metric` (String) +- `op` (String) +- `threshold` (String) diff --git a/docs/data-sources/qualityprofile.md b/docs/data-sources/qualityprofile.md new file mode 100644 index 00000000..934d009c --- /dev/null +++ b/docs/data-sources/qualityprofile.md @@ -0,0 +1,33 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "sonarqube_qualityprofile Data Source - terraform-provider-sonarqube" +subcategory: "" +description: |- + Use this data source to get a Sonarqube qualityprofile resource +--- + +# sonarqube_qualityprofile (Data Source) + +Use this data source to get a Sonarqube qualityprofile resource + +## Example Usage + +```terraform +data "sonarqube_qualityprofile" "main" { + name = "example" +} +``` + + +## Schema + +### Required + +- `name` (String) The name of the Quality Profile + +### Read-Only + +- `id` (String) The ID of this resource. +- `is_default` (Boolean) Quality Profile default +- `key` (String) The key of the Quality Profile +- `language` (String) Quality Profile language diff --git a/docs/data-sources/rule.md b/docs/data-sources/rule.md new file mode 100644 index 00000000..9263ca7e --- /dev/null +++ b/docs/data-sources/rule.md @@ -0,0 +1,36 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "sonarqube_rule Data Source - terraform-provider-sonarqube" +subcategory: "" +description: |- + Use this data source to get a Sonarqube rule resource +--- + +# sonarqube_rule (Data Source) + +Use this data source to get a Sonarqube rule resource + +## Example Usage + +```terraform +data "sonarqube_rule" "rule" { + key = "squid:forbidSonar" +} +``` + + +## Schema + +### Required + +- `key` (String) The key of the sonarqube rule. Should be :. https://next.sonarqube.com/sonarqube/web_api/api/rules?query=api%2Frules%2Fcreate + +### Read-Only + +- `id` (String) The ID of this resource. +- `markdown_description` (String) Rule description +- `name` (String) Rule name +- `severity` (String) Rule severity +- `status` (String) Rule status +- `template_key` (String) Key of the template rule +- `type` (String) Rule type diff --git a/docs/data-sources/sonarqube_group.md b/docs/data-sources/sonarqube_group.md deleted file mode 100644 index f14c595f..00000000 --- a/docs/data-sources/sonarqube_group.md +++ /dev/null @@ -1,26 +0,0 @@ -# Data Source: sonarqube_group - -Use this data source to get a Sonarqube Group resource - -## Example usage - -```terraform -data "sonarqube_group" "group" { - name = "terraform-test" -} -``` - - -## Argument Reference - -The following arguments are supported: - -- name - (Required) The name of the Group - -## Attributes Reference - -The following attributes are exported: - -- id - The ID of the Group. -- name - The name of the group. -- description - The group description. diff --git a/docs/data-sources/sonarqube_portfolio.md b/docs/data-sources/sonarqube_portfolio.md deleted file mode 100644 index a30ae10d..00000000 --- a/docs/data-sources/sonarqube_portfolio.md +++ /dev/null @@ -1,30 +0,0 @@ -# Data Source: sonarqube_portfolio - -Use this data source to get a Sonarqube portfolio resource - -## Example usage - -```terraform -data "sonarqube_portfolio" "portfolio" { - key = "portfolio-key" -} -``` - -## Argument Reference - -The following arguments are supported: - -- key - (Required) The key of the portfolio - -## Attributes Reference - -The following attributes are exported: - -- name - Name of the portfolio -- description - Description of the portfolio -- qualifier - `VW` (portfolios always have this qualifier) -- visibility - Portfolio visibility -- selection_mode - How the Portfolio is populated. Possible values are ``NONE``, ``MANUAL``, ``TAGS``, ``REGEXP`` or ``REST``. [See docs](https://docs.sonarqube.org/9.8/project-administration/managing-portfolios/#populating-portfolios) for how Portfolio population works -- branch - Which branch is analyzed -- tags - The list of tags used to populate the Portfolio. Only active when `selection_mode` is `TAGS` -- regexp - The regular expression used to populate the portfolio. Only active when `selection_mode` is `REGEXP` \ No newline at end of file diff --git a/docs/data-sources/sonarqube_project.md b/docs/data-sources/sonarqube_project.md deleted file mode 100644 index c81d1ad5..00000000 --- a/docs/data-sources/sonarqube_project.md +++ /dev/null @@ -1,25 +0,0 @@ -# Data Source: sonarqube_project - -Use this data source to get a Sonarqube project resource - -## Example usage - -```terraform -data "sonarqube_project" "project" { - project = "projet-key-id" -} -``` - -## Argument Reference - -The following arguments are supported: - -- project - (Required) The project key of the project - -## Attributes Reference - -The following attributes are exported: - -- name - Name of the project -- project - Key of the project -- visibility - Project visibility \ No newline at end of file diff --git a/docs/data-sources/sonarqube_qualitygate.md b/docs/data-sources/sonarqube_qualitygate.md deleted file mode 100644 index 814422ab..00000000 --- a/docs/data-sources/sonarqube_qualitygate.md +++ /dev/null @@ -1,26 +0,0 @@ -# Data Source: sonarqube_qualitygate - -Use this data source to get a Sonarqube qualitygate resource - -## Example usage - -```terraform -data "sonarqube_qualitygate" "main" { - name = "example" -} -``` - -## Argument Reference - -The following arguments are supported: - -- name - (Required) The name of the quality gate - -## Attributes Reference - -The following attributes are exported: - -- name - The name of the Quality Gate. -- copy_from - Origin of Quality Gate. -- is_default - Quality Gate default. -- condition - List of Quality Gate conditions. diff --git a/docs/data-sources/sonarqube_qualityprofile.md b/docs/data-sources/sonarqube_qualityprofile.md deleted file mode 100644 index cbf0030c..00000000 --- a/docs/data-sources/sonarqube_qualityprofile.md +++ /dev/null @@ -1,25 +0,0 @@ -# Data Source: sonarqube_qualityprofile - -Use this data source to get a Sonarqube qualityprofile resource - -## Example usage - -```terraform -data "sonarqube_qualityprofile" "main" { - name = "example" -} -``` - -## Argument Reference - -The following arguments are supported: - -- name - (Required) The name of the quality profile - -## Attributes Reference - -The following attributes are exported: - -- name - The name of the Quality Profile -- language - Quality profile language. -- is_default - Quality Profile default diff --git a/docs/data-sources/sonarqube_rule.md b/docs/data-sources/sonarqube_rule.md deleted file mode 100644 index e9288368..00000000 --- a/docs/data-sources/sonarqube_rule.md +++ /dev/null @@ -1,28 +0,0 @@ -# Data Source: sonarqube_rule - -Use this data source to get a Sonarqube rule resource - -## Example usage - -```terraform -data "sonarqube_rule" "rule" { - key = "squid:forbidSonar" -} -``` - -## Argument Reference - -The following arguments are supported: - -- key - (Required) The key of the sonarqube rule. Should be :. https://next.sonarqube.com/sonarqube/web_api/api/rules?query=api%2Frules%2Fcreate - -## Attributes Reference - -The following attributes are exported: - -- markdown_description - Rule description -- name - Rule name -- severity - Rule severity -- status - Rule status -- template_key - Key of the template rule -- type - Rule type \ No newline at end of file diff --git a/docs/data-sources/sonarqube_user.md b/docs/data-sources/sonarqube_user.md deleted file mode 100644 index 1e048154..00000000 --- a/docs/data-sources/sonarqube_user.md +++ /dev/null @@ -1,26 +0,0 @@ -# Data Source: sonarqube_user - -Use this data source to get a Sonarqube User resource - -## Example usage - -```terraform -data "sonarqube_user" "user" { - login_name = "terraform-test" -} -``` - - -## Argument Reference - -The following arguments are supported: - -- login_name - (Required) The login name of the User - -## Attributes Reference - -The following attributes are exported: - -- id - The ID of the User. -- login_name - The login name of the user -- email - The users email. \ No newline at end of file diff --git a/docs/data-sources/user.md b/docs/data-sources/user.md new file mode 100644 index 00000000..e5612289 --- /dev/null +++ b/docs/data-sources/user.md @@ -0,0 +1,33 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "sonarqube_user Data Source - terraform-provider-sonarqube" +subcategory: "" +description: |- + Use this data source to get a Sonarqube User resource +--- + +# sonarqube_user (Data Source) + +Use this data source to get a Sonarqube User resource + +## Example Usage + +```terraform +data "sonarqube_user" "user" { + login_name = "terraform-test" +} +``` + + +## Schema + +### Required + +- `login_name` (String) The login name of the user + +### Read-Only + +- `email` (String) The email of the user +- `id` (String) The ID of this resource. +- `is_local` (Boolean) Whether the user is local +- `name` (String) The name of the user diff --git a/docs/index.md b/docs/index.md index 4f3ff522..2aad5d6d 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,8 +1,15 @@ +--- +page_title: "Provider: sonarqube" +description: |- + The sonarqube provider is used to configure sonarqube. The provider needs to be configured with a url, and either with user and password or token. +--- + # Provider configuration The sonarqube provider is used to configure sonarqube. The provider needs to be configured with a url, and either with user and password or token. ## Example: Authenticate with username and password + ```terraform terraform { required_providers { @@ -14,12 +21,13 @@ terraform { provider "sonarqube" { user = "admin" - pass = "admin" + pass = "admin" host = "http://127.0.0.1:9000" } ``` ## Example: Authenticate with token + ```terraform terraform { required_providers { @@ -36,15 +44,16 @@ provider "sonarqube" { ``` ## Argument Reference + The following arguments are supported: - `user` - (Optional) Sonarqube user. This can also be set via the `SONARQUBE_USER` environment variable. - `pass` - (Optional) Sonarqube pass. This can also be set via the `SONARQUBE_PASS` environment variable. - `token` - (Optional) Sonarqube token. This can also be set via the `SONARQUBE_TOKEN` environment variable. - `host` - (Required) Sonarqube url. This can be also be set via the `SONARQUBE_HOST` environment variable. -- `installed_version` - (Optional) The version of the Sonarqube server. When specified, the provider will avoid requesting this from the +- `installed_version` - (Optional) The version of the Sonarqube server. When specified, the provider will avoid requesting this from the server during the initialization process. This can be helpful when using the same Terraform code to install Sonarqube and configure it. -- `tls_insecure_skip_verify` - (Optional) Allows ignoring insecure certificates when set to true. Defaults to false. Disabling TLS verification +- `tls_insecure_skip_verify` - (Optional) Allows ignoring insecure certificates when set to true. Defaults to false. Disabling TLS verification is dangerous and should only be done for local testing. -- `anonymize_user_on_delete` - (Optional) Allows anonymizing users on destroy. Requires Sonarqube version >= `9.7`. This can be helpful +- `anonymize_user_on_delete` - (Optional) Allows anonymizing users on destroy. Requires Sonarqube version >= `9.7`. This can be helpful to comply with regulations like [GDPR](https://en.wikipedia.org/wiki/General_Data_Protection_Regulation). diff --git a/docs/resources/alm_azure.md b/docs/resources/alm_azure.md new file mode 100644 index 00000000..03430d14 --- /dev/null +++ b/docs/resources/alm_azure.md @@ -0,0 +1,36 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "sonarqube_alm_azure Resource - terraform-provider-sonarqube" +subcategory: "" +description: |- + Provides a Sonarqube Azure Devops Alm/Devops Platform Integration resource. This can be used to create and manage a Alm/Devops + Platform Integration for Azure Devops. +--- + +# sonarqube_alm_azure (Resource) + +Provides a Sonarqube Azure Devops Alm/Devops Platform Integration resource. This can be used to create and manage a Alm/Devops +Platform Integration for Azure Devops. + +## Example Usage + +```terraform +resource "sonarqube_alm_azure" "az1" { + key = "az1" + personal_access_token = "my_pat" + url = "https://dev.azure.com/my-org" +} +``` + + +## Schema + +### Required + +- `key` (String) Unique key of the Azure Devops instance setting +- `personal_access_token` (String, Sensitive) Azure Devops personal access token +- `url` (String) Azure API URL + +### Read-Only + +- `id` (String) The ID of this resource. diff --git a/docs/resources/alm_github.md b/docs/resources/alm_github.md new file mode 100644 index 00000000..0bcc3b84 --- /dev/null +++ b/docs/resources/alm_github.md @@ -0,0 +1,47 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "sonarqube_alm_github Resource - terraform-provider-sonarqube" +subcategory: "" +description: |- + Provides a Sonarqube GitHub Alm/Devops Platform Integration resource. This can be used to create and manage a Alm/Devops + Platform Integration for GitHub. +--- + +# sonarqube_alm_github (Resource) + +Provides a Sonarqube GitHub Alm/Devops Platform Integration resource. This can be used to create and manage a Alm/Devops +Platform Integration for GitHub. + +## Example Usage + +```terraform +resource "sonarqube_alm_github" "github-alm" { + app_id = "12345" + client_id = "56789" + client_secret = "secret" + key = "myalm" + private_key = "myprivate_key" + url = "https://api.github.com" + webhook_secret = "mysecret" +} +``` + + +## Schema + +### Required + +- `app_id` (String) GitHub App ID. Maximum length: 80 +- `client_id` (String) GitHub App Client ID. Maximum length: 80 +- `client_secret` (String) GitHub App Client Secret. Maximum length: 160 +- `key` (String) Unique key of the GitHUb instance setting. Maximum length: 200 +- `private_key` (String) GitHub App private key. Maximum length: 2500 +- `url` (String) GitHub API URL. Maximum length: 2000 + +### Optional + +- `webhook_secret` (String) GitHub App Webhook Secret. Maximum length: 160 + +### Read-Only + +- `id` (String) The ID of this resource. diff --git a/docs/resources/alm_gitlab.md b/docs/resources/alm_gitlab.md new file mode 100644 index 00000000..36ed008b --- /dev/null +++ b/docs/resources/alm_gitlab.md @@ -0,0 +1,36 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "sonarqube_alm_gitlab Resource - terraform-provider-sonarqube" +subcategory: "" +description: |- + Provides a Sonarqube GitLab Alm/Devops Platform Integration resource. This can be used to create and manage a Alm/Devops + Platform Integration for GitLab. +--- + +# sonarqube_alm_gitlab (Resource) + +Provides a Sonarqube GitLab Alm/Devops Platform Integration resource. This can be used to create and manage a Alm/Devops +Platform Integration for GitLab. + +## Example Usage + +```terraform +resource "sonarqube_alm_gitlab" "gitlab-alm" { + key = "myalm" + personal_access_token = "my_personal_access_token" + url = "https://gitlab.com/api/v4" +} +``` + + +## Schema + +### Required + +- `key` (String) Unique key of the GitLab instance setting. Maximum length: 200 +- `personal_access_token` (String, Sensitive) GitLab App personal access token with the `read_api` scope. See [this doc](https://docs.sonarqube.org/latest/devops-platform-integration/gitlab-integration/#importing-your-gitlab-projects-into-sonarqube) for more information. Maximum length: 2000 +- `url` (String) GitLab API URL. Maximum length: 2000 + +### Read-Only + +- `id` (String) The ID of this resource. diff --git a/docs/resources/azure_binding.md b/docs/resources/azure_binding.md new file mode 100644 index 00000000..62346505 --- /dev/null +++ b/docs/resources/azure_binding.md @@ -0,0 +1,54 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "sonarqube_azure_binding Resource - terraform-provider-sonarqube" +subcategory: "" +description: |- + Provides a Sonarqube Azure Devops binding resource. This can be used to create and manage the binding between an + Azure Devops repository and a SonarQube project +--- + +# sonarqube_azure_binding (Resource) + +Provides a Sonarqube Azure Devops binding resource. This can be used to create and manage the binding between an +Azure Devops repository and a SonarQube project + +## Example Usage + +```terraform +resource "sonarqube_alm_azure" "az1" { + key = "az1" + personal_access_token = "my_pat" + url = "https://dev.azure.com/my-org" +} + +resource "sonarqube_project" "main" { + name = "SonarQube" + project = "main" + visibility = "public" +} + +resource "sonarqube_azure_binding" "main" { + alm_setting = sonarqube_alm_azure.az1.key + project = sonarqube_project.main.project + project_name = "my_azure_project" + repository_name = "my_repo" +} +``` + + +## Schema + +### Required + +- `alm_setting` (String) Azure DevOps setting key +- `project` (String) SonarQube project key +- `project_name` (String) Azure project name +- `repository_name` (String) Azure repository name + +### Optional + +- `monorepo` (Boolean) Is this project part of a monorepo + +### Read-Only + +- `id` (String) The ID of this resource. diff --git a/docs/resources/github_binding.md b/docs/resources/github_binding.md new file mode 100644 index 00000000..597bda37 --- /dev/null +++ b/docs/resources/github_binding.md @@ -0,0 +1,56 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "sonarqube_github_binding Resource - terraform-provider-sonarqube" +subcategory: "" +description: |- + Provides a Sonarqube GitHub binding resource. This can be used to create and manage the binding between a + GitHub repository and a SonarQube project +--- + +# sonarqube_github_binding (Resource) + +Provides a Sonarqube GitHub binding resource. This can be used to create and manage the binding between a +GitHub repository and a SonarQube project + +## Example Usage + +```terraform +resource "sonarqube_alm_github" "github-alm" { + app_id = "12345" + client_id = "56789" + client_secret = "secret" + key = "myalm" + private_key = "myprivate_key" + url = "https://api.github.com" + webhook_secret = "mysecret" +} + +resource "sonarqube_project" "main" { + name = "SonarQube" + project = "my_project" + visibility = "public" +} +resource "sonarqube_github_binding" "github-binding" { + alm_setting = sonarqube_alm_github.github-alm.key + project = "my_project" + repository = "myorg/myrepo" +} +``` + + +## Schema + +### Required + +- `alm_setting` (String) GitHub ALM setting key +- `project` (String) Project key +- `repository` (String) The full name of your GitHub repository, including the organization, case-sensitive. Maximum length: 256 + +### Optional + +- `monorepo` (String) Is this project part of a monorepo. Default value: false +- `summary_comment_enabled` (String) Enable/disable summary in PR discussion tab. Default value: true + +### Read-Only + +- `id` (String) The ID of this resource. diff --git a/docs/resources/gitlab_binding.md b/docs/resources/gitlab_binding.md new file mode 100644 index 00000000..423574da --- /dev/null +++ b/docs/resources/gitlab_binding.md @@ -0,0 +1,52 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "sonarqube_gitlab_binding Resource - terraform-provider-sonarqube" +subcategory: "" +description: |- + Provides a Sonarqube GitLab binding resource. This can be used to create and manage the binding between a + GitLab repository and a SonarQube project +--- + +# sonarqube_gitlab_binding (Resource) + +Provides a Sonarqube GitLab binding resource. This can be used to create and manage the binding between a +GitLab repository and a SonarQube project + +## Example Usage + +```terraform +resource "sonarqube_alm_gitlab" "gitlab-alm" { + key = "myalm" + personal_access_token = "my_personal_access_token" + url = "https://gitlab.com/api/v4" +} + +resource "sonarqube_project" "main" { + name = "SonarQube" + project = "my_project" + visibility = "public" +} + +resource "sonarqube_gitlab_binding" "gitlab-binding" { + alm_setting = sonarqube_alm_gitlab.gitlab-alm.key + project = "my_project" + repository = "123" +} +``` + + +## Schema + +### Required + +- `alm_setting` (String) GitLab ALM setting key +- `project` (String) SonarQube project key. Changing this will force a new resource to be created +- `repository` (String) The GitLab project ID + +### Optional + +- `monorepo` (String) Is this project part of a monorepo. Default value: false + +### Read-Only + +- `id` (String) The ID of this resource. diff --git a/docs/resources/group.md b/docs/resources/group.md new file mode 100644 index 00000000..42921e1d --- /dev/null +++ b/docs/resources/group.md @@ -0,0 +1,35 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "sonarqube_group Resource - terraform-provider-sonarqube" +subcategory: "" +description: |- + Provides a Sonarqube Group resource. This can be used to create and manage Sonarqube Groups. +--- + +# sonarqube_group (Resource) + +Provides a Sonarqube Group resource. This can be used to create and manage Sonarqube Groups. + +## Example Usage + +```terraform +resource "sonarqube_group" "project_users" { + name = "Project-Users" + description = "This is a group" +} +``` + + +## Schema + +### Required + +- `name` (String) The name of the Group to create. Changing this forces a new resource to be created. + +### Optional + +- `description` (String) Description of the Group. + +### Read-Only + +- `id` (String) The ID of this resource. diff --git a/docs/resources/group_member.md b/docs/resources/group_member.md new file mode 100644 index 00000000..0b5d4aff --- /dev/null +++ b/docs/resources/group_member.md @@ -0,0 +1,43 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "sonarqube_group_member Resource - terraform-provider-sonarqube" +subcategory: "" +description: |- + Provides a Sonarqube Group Member resource. This can be used to add or remove user to or from Sonarqube Groups. +--- + +# sonarqube_group_member (Resource) + +Provides a Sonarqube Group Member resource. This can be used to add or remove user to or from Sonarqube Groups. + +## Example Usage + +```terraform +resource "sonarqube_user" "user" { + login_name = "terraform-test" + name = "terraform-test" + password = "secret-sauce37!" +} + +resource "sonarqube_group" "project_users" { + name = "Project-Users" + description = "This is a group" +} + +resource "sonarqube_group_member" "project_users_member" { + name = sonarqube_group.project_users.name + login_name = sonarqube_user.user.login_name +} +``` + + +## Schema + +### Required + +- `login_name` (String) The `login_name` of the User to add as a member. Changing this forces a new resource to be created. +- `name` (String) The name of the Group to add a member to. Changing this forces a new resource to be created. + +### Read-Only + +- `id` (String) The ID of this resource. diff --git a/docs/resources/new_code_periods.md b/docs/resources/new_code_periods.md new file mode 100644 index 00000000..f52f0e65 --- /dev/null +++ b/docs/resources/new_code_periods.md @@ -0,0 +1,49 @@ +--- +page_title: "sonarqube_new_code_periods Resource - terraform-provider-sonarqube" +subcategory: "" +description: |- + Provides a Sonarqube New Code Periods resource. This can be used to manage Sonarqube New Code Periods. +--- + +# sonarqube_new_code_periods (Resource) + +Provides a Sonarqube New Code Periods resource. This can be used to manage Sonarqube New Code Periods. + +## Example Usage + +### Example: Set the global new code period to a number of days +```terraform +resource "sonarqube_new_code_periods" "code_period" { + type = "NUMBER_OF_DAYS" + value = "7" +} +``` + +### Example: create a project and set its new code period to a reference branch +```terraform +resource "sonarqube_project" "reference" { + name = "my-project" +} + +resource "sonarqube_new_code_periods" "reference" { + project = sonarqube_project.reference.project + type = "REFERENCE_BRANCH" + value = "main" +``` + + +## Schema + +### Required + +- `type` (String) The kind of new code period to use. Supported values are SPECIFIC_ANALYSIS, PREVIOUS_VERSION, NUMBER_OF_DAYS, or REFERENCE_BRANCH. + +### Optional + +- `branch` (String) The name of a branch of a project for which the new code period will be configured. Changing this will force a new resource to be created. Setting this also requires setting the 'project' argument. +- `project` (String) The key of a project for which the new code period will be configured. Changing this will force a new resource to be created. +- `value` (String) The desired value of the new code period. Varies based on the 'type'. For SPECIFIC_ANALYIS, the value must be the UUID of a previous analysis. For NUMBER_OF_DAYS it must be a numeric string. For REFERENCE_BRANCH it should be the name of branch on the project. For PREVIOUS_VERSION it must **not** be set. + +### Read-Only + +- `id` (String) The ID of this resource. diff --git a/docs/resources/permission_template.md b/docs/resources/permission_template.md new file mode 100644 index 00000000..4f27e999 --- /dev/null +++ b/docs/resources/permission_template.md @@ -0,0 +1,40 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "sonarqube_permission_template Resource - terraform-provider-sonarqube" +subcategory: "" +description: |- + Provides a Sonarqube Permission template resource. This can be used to create and manage Sonarqube Permission + templates. +--- + +# sonarqube_permission_template (Resource) + +Provides a Sonarqube Permission template resource. This can be used to create and manage Sonarqube Permission +templates. + +## Example Usage + +```terraform +resource "sonarqube_permission_template" "template" { + name = "Internal-Projects" + description = "These are internal projects" + project_key_pattern = "internal.*" +} +``` + + +## Schema + +### Required + +- `name` (String) The name of the Permission template to create. Do not use names with `/`. If needed, use `replace(var.permission_template_name, "/", "_")`. Changing this forces a new resource to be created. + +### Optional + +- `default` (Boolean) Set the template as the default. This can only be set for one template. +- `description` (String) Description of the Template. +- `project_key_pattern` (String) The project key pattern. Must be a valid Java regular expression. + +### Read-Only + +- `id` (String) The ID of this resource. diff --git a/docs/resources/permissions.md b/docs/resources/permissions.md new file mode 100644 index 00000000..1f81bb84 --- /dev/null +++ b/docs/resources/permissions.md @@ -0,0 +1,66 @@ +--- +page_title: "sonarqube_permissions Resource - terraform-provider-sonarqube" +subcategory: "" +description: |- + Provides a Sonarqube Permissions resource. This can be used to manage global and project permissions. +--- + +# sonarqube_permissions (Resource) + +Provides a Sonarqube Permissions resource. This can be used to manage global and project permissions. + +## Example Usage + +### Example: Set global admin permissions for a group called "my-admins" +```terraform +resource "sonarqube_permissions" "my_global_admins" { + group_name = "my-admins" + permissions = ["admin"] +} +``` + +### Example: Set project admin permissions for a group called "my-project-admins" +```terraform +resource "sonarqube_permissions" "my_project_admins" { + group_name = "my-project-admins" + project_key = "my-project" + permissions = ["admin"] +} +``` + +### Example: Set project admin permissions for a group called "my-project-admins on a permission template" +```terraform +resource "sonarqube_permissions" "internal_admins" { + group_name = "my-internal-admins" + template_id = sonarqube_permission_template.template.id + permissions = ["admin"] +} +``` + +### Example: Set codeviewer & user permissions on project level for a user called "johndoe" +```terraform +resource "sonarqube_permissions" "john_project_read" { + login_name = "johndoe" + project_key = "my-project" + permissions = ["codeviewer", "user"] +} +``` + + +## Schema + +### Required + +- `permissions` (List of String) A list of permissions that should be applied. Changing this forces a new resource to be created. Possible values are: `admin`, `codeviewer`, `issueadmin`, `securityhotspotadmin`, `scan`, `user`. + +### Optional + +- `group_name` (String) The name of the Group that should get the specified permissions. Changing this forces a new resource to be created. Cannot be used with `login_name` +- `login_name` (String) The name of the user that should get the specified permissions. Changing this forces a new resource to be created. Cannot be used with `group_name`. +- `project_key` (String) Specify if you want to apply project level permissions. Changing this forces a new resource to be created. Cannot be used with `template_id & template_name` +- `template_id` (String) Specify if you want to apply the permissions to a permission template. Changing this forces a new resource to be created. Cannot be used with `project_key & template_name` +- `template_name` (String) Specify if you want to apply the permissions to a permission template. Changing this forces a new resource to be created. Cannot be used with `project_key & template_id` + +### Read-Only + +- `id` (String) The ID of this resource. diff --git a/docs/resources/plugin.md b/docs/resources/plugin.md new file mode 100644 index 00000000..d180a703 --- /dev/null +++ b/docs/resources/plugin.md @@ -0,0 +1,30 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "sonarqube_plugin Resource - terraform-provider-sonarqube" +subcategory: "" +description: |- + Provides a Sonarqube Plugin resource. This can be used to create and manage Sonarqube Plugins. +--- + +# sonarqube_plugin (Resource) + +Provides a Sonarqube Plugin resource. This can be used to create and manage Sonarqube Plugins. + +## Example Usage + +```terraform +resource "sonarqube_plugin" "main" { + key = "cloudformation" +} +``` + + +## Schema + +### Required + +- `key` (String) The key identifying the plugin to uninstall. + +### Read-Only + +- `id` (String) The ID of this resource. diff --git a/docs/resources/portfolio.md b/docs/resources/portfolio.md new file mode 100644 index 00000000..fd8ff220 --- /dev/null +++ b/docs/resources/portfolio.md @@ -0,0 +1,55 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "sonarqube_portfolio Resource - terraform-provider-sonarqube" +subcategory: "" +description: |- + Provides a Sonarqube Portfolio resource. This can be used to create and manage Sonarqube Portfolio. Note that the SonarQube API for Portfolios is called views +--- + +# sonarqube_portfolio (Resource) + +Provides a Sonarqube Portfolio resource. This can be used to create and manage Sonarqube Portfolio. Note that the SonarQube API for Portfolios is called ``views`` + +## Example Usage + +```terraform +resource "sonarqube_portfolio" "main" { + key = "portfolio-key" + name = "portfolio-name" + description = "portfolio-description" +} +``` + + +## Schema + +### Required + +- `description` (String) A description of the Portfolio to create +- `key` (String) The key of the Portfolio to create +- `name` (String) The name of the Portfolio to create + +### Optional + +- `branch` (String) Which branch to analyze. If nothing, or '' is specified, the main branch is used. +- `regexp` (String) A regular expression that is used to match Projects with a matching name OR key. If they match, they are added to the Portfolio +- `selected_projects` (Block Set) A set of projects to add to the portfolio. (see [below for nested schema](#nestedblock--selected_projects)) +- `selection_mode` (String) How to populate the Portfolio to create. Possible values are `NONE`, `MANUAL`, `TAGS`, `REGEXP` or `REST`. [See docs](https://docs.sonarqube.org/9.8/project-administration/managing-portfolios/#populating-portfolios) for how Portfolio population works +- `tags` (List of String) List of Project tags to populate the Portfolio from. Only active when `selection_mode` is `TAGS` +- `visibility` (String) Whether the created portfolio should be visible to everyone, or only specific user/groups. If no visibility is specified, the default portfolio visibility will be `public`. + +### Read-Only + +- `id` (String) The ID of this resource. +- `qualifier` (String) + + +### Nested Schema for `selected_projects` + +Required: + +- `project_key` (String) The project key of the project to add to the portfolio + +Optional: + +- `selected_branches` (Set of String) A set of branches for the project to add to the portfolio diff --git a/docs/resources/project.md b/docs/resources/project.md new file mode 100644 index 00000000..2fcebe8e --- /dev/null +++ b/docs/resources/project.md @@ -0,0 +1,66 @@ +--- +page_title: "sonarqube_project Resource - terraform-provider-sonarqube" +subcategory: "" +description: |- + Provides a Sonarqube Project resource. This can be used to create and manage Sonarqube Project. +--- + +# sonarqube_project (Resource) + +Provides a Sonarqube Project resource. This can be used to create and manage Sonarqube Project. + + +## Example Usage +### Example: create a project +```terraform +resource "sonarqube_project" "main" { + name = "SonarQube" + project = "my_project" + visibility = "public" +} +``` + +### Example: a project with associated settings +```terraform +resource "sonarqube_project" "main" { + name = "SonarQube" + project = "my_project" + visibility = "public" + + setting { + key = "sonar.demo" + value = "sonarqube@example.org" + } +} +``` + + +## Schema + +### Required + +- `name` (String) The name of the Project to create +- `project` (String) Key of the project. Maximum length 400. All letters, digits, dash, underscore, period or colon. + +### Optional + +- `setting` (Block List) A list of settings associated to the project (see [below for nested schema](#nestedblock--setting)) +- `tags` (List of String) A list of tags to put on the project. +- `visibility` (String) Whether the created project should be visible to everyone, or only specific user/groups. If no visibility is specified, the default project visibility of the organization will be used. Valid values are `public` and `private`. + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `setting` + +Required: + +- `key` (String) Setting key + +Optional: + +- `field_values` (List of Map of String) Setting field values for the supplied key +- `value` (String) Setting a value for the supplied key +- `values` (List of String) Setting multi values for the supplied key diff --git a/docs/resources/project_main_branch.md b/docs/resources/project_main_branch.md new file mode 100644 index 00000000..2e18de4f --- /dev/null +++ b/docs/resources/project_main_branch.md @@ -0,0 +1,37 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "sonarqube_project_main_branch Resource - terraform-provider-sonarqube" +subcategory: "" +description: |- + Provides a Sonarqube Project main branch resource. This can be used to create and manage a Sonarqube Projects main branch. +--- + +# sonarqube_project_main_branch (Resource) + +Provides a Sonarqube Project main branch resource. This can be used to create and manage a Sonarqube Projects main branch. + +## Example Usage + +```terraform +resource "sonarqube_project" "main" { + name = "SonarQube" + project = "my_project" + visibility = "public" +} +resource "sonarqube_project_main_branch" "mybranch" { + name = "release" + project = "my_project" +} +``` + + +## Schema + +### Required + +- `name` (String) The name you want the main branch to have. +- `project` (String) Key of the project. Maximum length 400. All letters, digits, dash, underscore, period or colon. + +### Read-Only + +- `id` (String) The ID of this resource. diff --git a/docs/resources/qualitygate.md b/docs/resources/qualitygate.md new file mode 100644 index 00000000..809b0eb9 --- /dev/null +++ b/docs/resources/qualitygate.md @@ -0,0 +1,92 @@ +--- +page_title: "sonarqube_qualitygate Resource - terraform-provider-sonarqube" +subcategory: "" +description: |- + Provides a Sonarqube Quality Gate resource. This can be used to create and manage Sonarqube Quality Gates and their Conditions. +--- + +# sonarqube_qualitygate (Resource) + +Provides a Sonarqube Quality Gate resource. This can be used to create and manage Sonarqube Quality Gates and their Conditions. + + +## Example Usage + +```terraform +resource "sonarqube_qualitygate" "main" { + name = "example" + is_default = true + + condition { + metric = "new_coverage" + op = "LT" + threshold = "50" + } + + condition { + metric = "vulnerabilities" + threshold = "10" + op = "GT" + } +} +``` + +**Disclaimer: Operator Requirement for Grade Rating Conditions** + +When working with grade rating conditions, (A-D), it is important to note that the "GT" (greater than) operator must be used for the `op` field. This is due to SonarQube's API design. More information can be found in this [issue](https://github.com/jdamata/terraform-provider-sonarqube/issues/171). + +For example, if you are using a grade rating metric such as `new_reliability_rating`, where A represents the highest rating and subsequent letters represent lower ratings, you need to supply the `op` field with "GT" via the provider. Using "LT" will return an error from SonarQube's API: + +```terraform + condition { + metric = "new_reliability_rating" + op = "GT" + threshold = "1" + } +``` + + +## Schema + +### Required + +- `name` (String) The name of the Quality Gate to create. Maximum length 100. + +### Optional + +- `condition` (Block List) A list of conditions that the gate uses. (see [below for nested schema](#nestedblock--condition)) +- `copy_from` (String) Name of an existing Quality Gate to copy from. +- `is_default` (Boolean) When set to true this Quality Gate is set as default. + +### Read-Only + +- `id` (String) The ID of this resource. + + +### Nested Schema for `condition` + +Required: + +- `metric` (String) Condition metric. + + Only metrics of the following types are allowed: + + - INT + - MILLISEC + - RATING + - WORK_DUR + - FLOAT + - PERCENT + - LEVEL. + + The following metrics are forbidden: + + - alert_status + - security_hotspots + - new_security_hotspots +- `op` (String) Condition operator. Possible values are: LT and GT +- `threshold` (String) Condition error threshold (For ratings: A=1, B=2, C=3, D=4) + +Read-Only: + +- `id` (String) diff --git a/docs/resources/qualitygate_project_association.md b/docs/resources/qualitygate_project_association.md new file mode 100644 index 00000000..fb094c41 --- /dev/null +++ b/docs/resources/qualitygate_project_association.md @@ -0,0 +1,54 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "sonarqube_qualitygate_project_association Resource - terraform-provider-sonarqube" +subcategory: "" +description: |- + Provides a Sonarqube Quality Gate Project association resource. This can be used to associate a Quality Gate to a Project +--- + +# sonarqube_qualitygate_project_association (Resource) + +Provides a Sonarqube Quality Gate Project association resource. This can be used to associate a Quality Gate to a Project + +## Example Usage + +```terraform +## Example: create a quality gate project association + +resource "sonarqube_qualitygate" "main" { + name = "my_qualitygate" + + condition { + metric = "new_coverage" + op = "LT" + threshold = "30" + } +} + +resource "sonarqube_project" "main" { + name = "SonarQube" + project = "my_project" + visibility = "public" +} + +resource "sonarqube_qualitygate_project_association" "main" { + gatename = sonarqube_qualitygate.main.id + projectkey = sonarqube_project.main.project +} +``` + + +## Schema + +### Required + +- `projectkey` (String) Key of the project. Maximum length 400. All letters, digits, dash, underscore, period or colon. + +### Optional + +- `gateid` (String) +- `gatename` (String) The name of the Quality Gate + +### Read-Only + +- `id` (String) The ID of this resource. diff --git a/docs/resources/qualitygate_usergroup_association.md b/docs/resources/qualitygate_usergroup_association.md new file mode 100644 index 00000000..be405f4f --- /dev/null +++ b/docs/resources/qualitygate_usergroup_association.md @@ -0,0 +1,76 @@ +--- +page_title: "sonarqube_qualitygate_usergroup_association Resource - terraform-provider-sonarqube" +subcategory: "" +description: |- + Provides a Sonarqube Quality Gate Usergroup association resource. This can be used to associate a Quality Gate to an User or to a Group. + The feature is available on SonarQube 9.2 or newer. +--- + +# sonarqube_qualitygate_usergroup_association (Resource) + +Provides a Sonarqube Quality Gate Usergroup association resource. This can be used to associate a Quality Gate to an User or to a Group. +The feature is available on SonarQube 9.2 or newer. + +## Example Usage +### Example: create a quality gate user association +```terraform +resource "sonarqube_qualitygate" "main" { + name = "my_qualitygate" + + condition { + metric = "new_coverage" + op = "LT" + threshold = "30" + } +} + +resource "sonarqube_user" "qa_user" { + login_name = "qa-user" + name = "qa-user" + password = "secret-sauce37!" +} + +resource "sonarqube_qualitygate_usergroup_association" "main" { + gatename = sonarqube_qualitygate.main.id + login_name = sonarqube_user.qa_user.id +} +``` + +### Example: create a quality gate group association +```terraform +resource "sonarqube_qualitygate" "main" { + name = "my_qualitygate" + + condition { + metric = "new_coverage" + op = "LT" + threshold = "30" + } +} + +resource "sonarqube_group" "qa_team" { + name = "QA-Team" + description = "Quality Assurence Team" +} + +resource "sonarqube_qualitygate_usergroup_association" "main" { + gatename = sonarqube_qualitygate.main.id + group_name = sonarqube_group.qa_team.name +} +``` + + +## Schema + +### Required + +- `gatename` (String) The name of the Quality Gate + +### Optional + +- `group_name` (String) The name of the Group to associate. Either `group_name` or `login_name` should be provided. +- `login_name` (String) The name of the User to associate. Either `group_name` or `login_name` should be provided. + +### Read-Only + +- `id` (String) The ID of this resource. diff --git a/docs/resources/qualityprofile.md b/docs/resources/qualityprofile.md new file mode 100644 index 00000000..91c2c9d9 --- /dev/null +++ b/docs/resources/qualityprofile.md @@ -0,0 +1,40 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "sonarqube_qualityprofile Resource - terraform-provider-sonarqube" +subcategory: "" +description: |- + Provides a Sonarqube Quality Profile resource. This can be used to create and manage Sonarqube Quality Profiles. +--- + +# sonarqube_qualityprofile (Resource) + +Provides a Sonarqube Quality Profile resource. This can be used to create and manage Sonarqube Quality Profiles. + +## Example Usage + +```terraform +resource "sonarqube_qualityprofile" "main" { + name = "example" + language = "js" + is_default = false + parent = "sonar way" +} +``` + + +## Schema + +### Required + +- `language` (String) Quality profile language. Must be one of "cs", "css", "flex", "go", "java", "js", "jsp", "kotlin", "php", "py", "ruby", "scala", "ts", "vbnet", "web", "xml" +- `name` (String) The name of the Quality Profile to create. Maximum length 100 + +### Optional + +- `is_default` (Boolean) When set to true this will make the added Quality Profile default +- `parent` (String) When a parent is provided the quality profile will inherit it's rules + +### Read-Only + +- `id` (String) The ID of this resource. +- `key` (String) ID of the Sonarqube Quality Profile diff --git a/docs/resources/qualityprofile_activate_rule.md b/docs/resources/qualityprofile_activate_rule.md new file mode 100644 index 00000000..a63cdb8e --- /dev/null +++ b/docs/resources/qualityprofile_activate_rule.md @@ -0,0 +1,59 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "sonarqube_qualityprofile_activate_rule Resource - terraform-provider-sonarqube" +subcategory: "" +description: |- + Provides a Sonarqube Rules resource. This can be used to manage Sonarqube rules. +--- + +# sonarqube_qualityprofile_activate_rule (Resource) + +Provides a Sonarqube Rules resource. This can be used to manage Sonarqube rules. + +## Example Usage + +```terraform +resource "sonarqube_rule" "allowed_maven_dependencies" { + custom_key = "Only_use_allowed_Maven_dependencies" + markdown_description = "Description" + name = "Only use allowed Maven dependencies" + params = "FilePattern=**/pom.xml" + severity = "BLOCKER" + status = "READY" + template_key = "xml:XPathCheck" + type = "VULNERABILITY" +} + +resource "sonarqube_qualityprofile" "xml" { + name = "test way - xml" + language = "xml" + is_default = "false" + parent = "Sonar way" +} + +resource "sonarqube_qualityprofile_activate_rule" "xml_rule" { + key = sonarqube_qualityprofile.xml.key # .id also works + rule = sonarqube_rule.allowed_maven_dependencies.id + severity = "BLOCKER" +} +``` + + +## Schema + +### Required + +- `key` (String) Quality Profile key. Can be obtained through api/qualityprofiles/search +- `rule` (String) Rule key + +### Optional + +- `params` (String) Parameters as semi-colon list of =, for example 'params=key1=v1;key2=v2' (Only for custom rule) +- `reset` (String) Reset severity and parameters of activated rule. Set the values defined on parent profile or from rule default values. + - Possible values true false yes no (Default false) +- `severity` (String) Severity. Ignored if parameter reset is true. + - Possible values - INFO, MINOR, MAJOR, CRITICAL, BLOCKER + +### Read-Only + +- `id` (String) The ID of this resource. diff --git a/docs/resources/qualityprofile_project_association.md b/docs/resources/qualityprofile_project_association.md new file mode 100644 index 00000000..a0a4d853 --- /dev/null +++ b/docs/resources/qualityprofile_project_association.md @@ -0,0 +1,45 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "sonarqube_qualityprofile_project_association Resource - terraform-provider-sonarqube" +subcategory: "" +description: |- + Provides a Sonarqube Quality Profile Project association resource. This can be used to associate a Quality Profile to a Project +--- + +# sonarqube_qualityprofile_project_association (Resource) + +Provides a Sonarqube Quality Profile Project association resource. This can be used to associate a Quality Profile to a Project + +## Example Usage + +```terraform +resource "sonarqube_qualityprofile" "main" { + name = "my_quality_profile" + language = "js" +} + +resource "sonarqube_project" "main" { + name = "SonarQube" + project = "my_project" + visibility = "public" +} + +resource "sonarqube_qualityprofile_project_association" "main" { + quality_profile = sonarqube_qualityprofile.main.name + project = sonarqube_project.main.project + language = "js" +} +``` + + +## Schema + +### Required + +- `language` (String) Quality profile language. Must be a langauge in this list https://next.sonarqube.com/sonarqube/web_api/api/languages/list +- `project` (String) Name of the project +- `quality_profile` (String) Name of the Quality Profile + +### Read-Only + +- `id` (String) The ID of this resource. diff --git a/docs/resources/rule.md b/docs/resources/rule.md new file mode 100644 index 00000000..0124d677 --- /dev/null +++ b/docs/resources/rule.md @@ -0,0 +1,42 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "sonarqube_rule Resource - terraform-provider-sonarqube" +subcategory: "" +description: |- + Provides a Sonarqube Rules resource. This can be used to manage Sonarqube rules. +--- + +# sonarqube_rule (Resource) + +Provides a Sonarqube Rules resource. This can be used to manage Sonarqube rules. + + + + +## Schema + +### Required + +- `custom_key` (String) key of the custom rule should only contain : a-z, 0-9, \_ +- `markdown_description` (String) Rule description +- `name` (String) Rule name +- `template_key` (String) Key of the template rule in order to create a custom rule (mandatory for custom rule) + - [Example values](https://docs.sonarqube.org/latest/user-guide/rules/#header-4) + +### Optional + +- `params` (String) Parameters as semi-colon list of =, for example 'params=key1=v1;key2=v2' (Only for custom rule) + - parameter order: expression=value;filePattern=value;message=value +- `prevent_reactivation` (String) If set to true and if the rule has been deactivated (status 'REMOVED'), a status 409 will be returned + - Possible values - true, false, yes, no +- `severity` (String) Rule severity + - Possible values - INFO, MINOR, MAJOR, CRITICAL, BLOCKER +- `status` (String) Rule status + - Possible values - BETA, DEPRECATED, READY, REMOVED + - Default value - READY +- `type` (String) Rule type + - Possible values - CODE_SMELL, BUG, VULNERABILITY, SECURITY_HOTSPOT + +### Read-Only + +- `id` (String) The ID of this resource. diff --git a/docs/resources/setting.md b/docs/resources/setting.md new file mode 100644 index 00000000..b0d0790e --- /dev/null +++ b/docs/resources/setting.md @@ -0,0 +1,53 @@ +--- +page_title: "sonarqube_setting Resource - terraform-provider-sonarqube" +subcategory: "" +description: |- + Provides a Sonarqube Settings resource. This can be used to manage Sonarqube settings. +--- + +# sonarqube_setting (Resource) + +Provides a Sonarqube Settings resource. This can be used to manage Sonarqube settings. + +## Example Usage +### Example: create a setting with multiple values +```terraform +resource "sonarqube_setting" "multi_value_setting" { + key = "sonar.global.exclusions" + values = ["foo", "bar/**/*.*"] +} +``` + +### Example: create a setting with multiple field values +```terraform +resource "sonarqube_setting" "multi_field_setting" { + key = "sonar.issue.ignore.multicriteria" + field_values = [ + { + "ruleKey" : "foo", + "resourceKey" : "bar" + }, + { + "ruleKey" : "foo2", + "resourceKey" : "bar2" + } + ] +} +``` + + +## Schema + +### Required + +- `key` (String) Setting key + +### Optional + +- `field_values` (List of Map of String) Setting field values for the supplied key +- `value` (String) Setting value. To reset a value, please use the reset web service. +- `values` (List of String) Setting multi values for the supplied key + +### Read-Only + +- `id` (String) The ID of this resource. diff --git a/docs/resources/sonarqube_alm_azure.md b/docs/resources/sonarqube_alm_azure.md deleted file mode 100644 index 3a873351..00000000 --- a/docs/resources/sonarqube_alm_azure.md +++ /dev/null @@ -1,37 +0,0 @@ -# sonarqube_alm_azure - -Provides a Sonarqube Azure Devops Alm/Devops Platform Integration resource. This can be used to create and manage a Alm/Devops -Platform Integration for Azure Devops. - -## Example: Create an Azure Devops Alm Integration - -```terraform -resource "sonarqube_alm_azure" "az1" { - key = "az1" - personal_access_token = "my_pat" - url = "https://dev.azure.com/my-org" -} -``` - -## Argument Reference - -The following arguments are supported: - -- key - (Required) - Unique key of the azure alm instance setting. Maximum length: 200 -- personal_access_token - (Required) - Azure Devops Personal Access Token. Maximum length: 2000 -- url - (Required) - Azure Devops Organization URL. Maximum length: 2000 - -## Attributes Reference - -The following attributes are exported: - -- key - The unique key of the azure alm instance setting. -- url - Azure Devops Organization URL. - -## Import - -Resource can be imported providing their Alm Instance Key and Azure DevOps Personal Access Token - -```terraform -terraform import sonarqube_alm_azure.az1 key/personal_access_token -``` diff --git a/docs/resources/sonarqube_alm_github.md b/docs/resources/sonarqube_alm_github.md deleted file mode 100644 index dbfff025..00000000 --- a/docs/resources/sonarqube_alm_github.md +++ /dev/null @@ -1,40 +0,0 @@ -# sonarqube_alm_github - -Provides a Sonarqube GitHub Alm/Devops Platform Integration resource. This can be used to create and manage a Alm/Devops -Platform Integration for GitHub. - -## Example: Create a GitHub Alm Integration - -```terraform -resource "sonarqube_alm_github" "github-alm" { - app_id = "12345" - client_id = "56789" - client_secret = "secret" - key = "myalm" - private_key = "myprivate_key" - url = "https://api.github.com" - webhook_secret = "mysecret" -} -``` - -## Argument Reference - -The following arguments are supported: - -- app_id - (Required) - GitHub App ID. Maximum length: 80 -- client_id - (Required) - GitHub App Client ID. Maximum length: 80 -- client_secret - (Required) - GitHub App Client Secret. Maximum length: 160 -- key - (Required) - Unique key of the GitHub instance setting. Maximum length: 200 -- private_key - (Required) - GitHub App private key. Maximum length: 2500 -- url - (Required) - GitHub API URL. Maximum length: 2000 -- webhook_secret - (Optional) - GitHub App Webhook Secret. Maximum length: 160 - -## Attributes Reference - -The following attributes are exported: - -- app_id - GitHub App ID. -- client_id - GitHub App Client ID. -- key - The unique key of the GitHub instance setting. -- url - GitHub API URL. - diff --git a/docs/resources/sonarqube_alm_gitlab.md b/docs/resources/sonarqube_alm_gitlab.md deleted file mode 100644 index 89ee5e19..00000000 --- a/docs/resources/sonarqube_alm_gitlab.md +++ /dev/null @@ -1,30 +0,0 @@ -# sonarqube_alm_gitlab - -Provides a Sonarqube GitLab Alm/Devops Platform Integration resource. This can be used to create and manage a Alm/Devops -Platform Integration for GitLab. - -## Example: Create a GitHub Alm Integration - -```terraform -resource "sonarqube_alm_gitlab" "gitlab-alm" { - key = "myalm" - personal_access_token = "my_personal_access_token" - url = "https://gitlab.com/api/v4" -} -``` - -## Argument Reference - -The following arguments are supported: - -- key - (Required) - Unique key of the GitLab instance setting. Maximum length: 200 -- personal_access_token - (Required) - GitLab App personal access token with the `read_api` scope. See [this doc](https://docs.sonarqube.org/latest/devops-platform-integration/gitlab-integration/#importing-your-gitlab-projects-into-sonarqube) for more information. Maximum length: 2000 -- url - (Required) - GitLab API URL. Maximum length: 2000 - -## Attributes Reference - -The following attributes are exported: - -- key - The unique key of the GitLab instance setting. -- url - GitLab API URL. - diff --git a/docs/resources/sonarqube_azure_binding.md b/docs/resources/sonarqube_azure_binding.md deleted file mode 100644 index 5fb9ce9b..00000000 --- a/docs/resources/sonarqube_azure_binding.md +++ /dev/null @@ -1,54 +0,0 @@ -# sonarqube_azure_binding - -Provides a Sonarqube Azure Devops binding resource. This can be used to create and manage the binding between an -Azure Devops repository and a SonarQube project - -## Example: Create an Azure Devops binding - -```terraform -resource "sonarqube_alm_azure" "az1" { - key = "az1" - personal_access_token = "my_pat" - url = "https://dev.azure.com/my-org" -} - -resource "sonarqube_project" "main" { - name = "SonarQube" - project = "main" - visibility = "public" -} - -resource "sonarqube_azure_binding" "main" { - alm_setting = sonarqube_alm_azure.az1.key - project = sonarqube_project.main.project - project_name = "my_azure_project" - repository_name = "my_repo" -} -``` - -## Argument Reference - -The following arguments are supported: - -- alm_setting - (Required) - azure ALM setting key -- monorepo - (Optional) - Is this project part of a monorepo. Default value: false -- project - (Required) - SonarQube Project key -- project_name - (Required) - Azure DevOps Project name -- repository_name - (Required) - Azure DevOps Repository name - -## Attributes Reference - -The following attributes are exported: - -- alm_setting - The unique key of the azure alm instance setting. -- project - SonarQube Project key. -- project_name - Azure DevOps Project name. -- repository_name - Azure DevOps Repository name. - -## Import - -Bindings can be imported using their ID - -```terraform -terraform import sonarqube_azure_binding.main project/project_name/repository -``` diff --git a/docs/resources/sonarqube_github_binding.md b/docs/resources/sonarqube_github_binding.md deleted file mode 100644 index 55124585..00000000 --- a/docs/resources/sonarqube_github_binding.md +++ /dev/null @@ -1,55 +0,0 @@ -# sonarqube_github_binding - -Provides a Sonarqube GitHub binding resource. This can be used to create and manage the binding between a -GitHub repository and a SonarQube project - -## Example: Create a GitHub binding - -```terraform -resource "sonarqube_alm_github" "github-alm" { - app_id = "12345" - client_id = "56789" - client_secret = "secret" - key = "myalm" - private_key = "myprivate_key" - url = "https://api.github.com" - webhook_secret = "mysecret" -} - -resource "sonarqube_project" "main" { - name = "SonarQube" - project = "my_project" - visibility = "public" -} -resource "sonarqube_github_binding" "github-binding" { - alm_setting = sonarqube_alm_github.github-alm.key - project = "my_project" - repository = "myorg/myrepo" -} -``` - -## Argument Reference - -The following arguments are supported: - -- alm_setting - (Required) - GitHub ALM setting key -- monorepo - (Optional) - Is this project part of a monorepo. Default value: false -- project - (Required) - Project key -- repository - (Required) - The full name of your GitHub repository, including the organization, case-sensitive. Maximum length: 256 -- summary_comment_enabled - (optional) - Enable/disable summary in PR discussion tab. Default value: true - -## Attributes Reference - -The following attributes are exported: - -- project - Project key. -- repository - GitHub Repository. -- alm_setting - The unique key of the GitHub instance setting. - -## Import - -Bindings can be imported using their ID - -```terraform -terraform import sonarqube_github_binding.github-binding project/repository -``` \ No newline at end of file diff --git a/docs/resources/sonarqube_gitlab_binding.md b/docs/resources/sonarqube_gitlab_binding.md deleted file mode 100644 index 7be9ed4e..00000000 --- a/docs/resources/sonarqube_gitlab_binding.md +++ /dev/null @@ -1,51 +0,0 @@ -# sonarqube_gitlab_binding - -Provides a Sonarqube GitLab binding resource. This can be used to create and manage the binding between a -GitLab repository and a SonarQube project - -## Example: Create a GitLab binding - -```terraform -resource "sonarqube_alm_gitlab" "gitlab-alm" { - key = "myalm" - personal_access_token = "my_personal_access_token" - url = "https://gitlab.com/api/v4" -} - -resource "sonarqube_project" "main" { - name = "SonarQube" - project = "my_project" - visibility = "public" -} - -resource "sonarqube_gitlab_binding" "gitlab-binding" { - alm_setting = sonarqube_alm_gitlab.gitlab-alm.key - project = "my_project" - repository = "123" -} -``` - -## Argument Reference - -The following arguments are supported: - -- alm_setting - (Required) - GitLab ALM setting key -- monorepo - (Optional) - Is this project part of a monorepo. Default value: false -- project - (Required) - SonarQube project key. Changing this will force a new resource to be created. -- repository - (Required) - The GitLab project ID. - -## Attributes Reference - -The following attributes are exported: - -- project - SonarQube unique project key. -- repository - GitLab project ID. -- alm_setting - The unique key of the GitLab instance setting. - -## Import - -Bindings can be imported using their ID - -```terraform -terraform import sonarqube_gitlab_binding.gitlab-binding project/repository -``` diff --git a/docs/resources/sonarqube_group.md b/docs/resources/sonarqube_group.md deleted file mode 100644 index a0256838..00000000 --- a/docs/resources/sonarqube_group.md +++ /dev/null @@ -1,33 +0,0 @@ -# sonarqube_group - -Provides a Sonarqube Group resource. This can be used to create and manage Sonarqube Groups. - -## Example: create a group - -```terraform -resource "sonarqube_group" "project_users" { - name = "Project-Users" - description = "This is a group" -} -``` - -## Argument Reference - -The following arguments are supported: - -- name - (Required) The name of the Group to create. Changing this forces a new resource to be created. -- description - (Optional) Description of the Group. - -## Attributes Reference - -The following attributes are exported: - -- id - The ID of the Group. - -## Import - -Groups can be imported using their ID, and only support in the Sonarqube version <= 9.9 - -```terraform -terraform import sonarqube_group.group 101 -``` diff --git a/docs/resources/sonarqube_group_member.md b/docs/resources/sonarqube_group_member.md deleted file mode 100644 index b4c5d212..00000000 --- a/docs/resources/sonarqube_group_member.md +++ /dev/null @@ -1,44 +0,0 @@ -# sonarqube_group_member - -Provides a Sonarqube Group Member resource. This can be used to add or remove user to or from Sonarqube Groups. - -## Example: add a user to a group - -```terraform -resource "sonarqube_user" "user" { - login_name = "terraform-test" - name = "terraform-test" - password = "secret-sauce37!" -} - -resource "sonarqube_group" "project_users" { - name = "Project-Users" - description = "This is a group" -} - -resource "sonarqube_group_member" "project_users_member" { - name = sonarqube_group.project_users.name - login_name = sonarqube_user.user.login_name -} -``` - -## Argument Reference - -The following arguments are supported: - -- `name` - (Required) The name of the Group to add a member to. Changing this forces a new resource to be created. -- `login_name` - (Required) The `login_name` of the User to add as a member. Changing this forces a new resource to be created. - -## Attributes Reference - -The following attributes are exported: - -- id - The ID of the Group Membership. - -## Import - -Group Members can be imported using their ID (`[]`): - -```terraform -terraform import sonarqube_group_member.member group[user] -``` diff --git a/docs/resources/sonarqube_new_code_periods.md b/docs/resources/sonarqube_new_code_periods.md deleted file mode 100644 index eaa9170a..00000000 --- a/docs/resources/sonarqube_new_code_periods.md +++ /dev/null @@ -1,44 +0,0 @@ -# sonarqube_new_code_periods - -Provides a Sonarqube New Code Periods resource. This can be used to manage Sonarqube New Code Periods. - -## Example: Set the global new code period to a number of days - -```terraform -resource "sonarqube_new_code_periods" "code_period" { - type = "NUMBER_OF_DAYS" - value = "7" -} -``` - -## Example: create a project and set its new code period to a reference branch - -```terraform -resource "sonarqube_project" "reference" { - name = "my-project" -} - -resource "sonarqube_new_code_periods" "reference" { - project = sonarqube_project.reference.project - type = "REFERENCE_BRANCH" - value = "main" -``` - -## Argument Reference - -The following arguments are supported: - -- type - (Required) The kind of new code period to use. Supported values are SPECIFIC_ANALYSIS, PREVIOUS_VERSION, NUMBER_OF_DAYS, or REFERENCE_BRANCH. -- project - (Optional) The key of a project for which the new code period will be configured. Changing this will force a new resource to be created. -- branch - (Optional) The name of a branch of a project for which the new code period will be configured. Changing this will force a new resource to be created. Setting this also requires setting the 'project' argument. -- value - (Optional) The desired value of the new code period. Varies based on the 'type'. For SPECIFIC_ANALYIS, the value must be the UUID of a previous analysis. For NUMBER_OF_DAYS it must be a numeric string. For REFERENCE_BRANCH it should be the name of branch on the project. For PREVIOUS_VERSION it must **not** be set. - -## Attributes Reference - -The following attributes are exported: - -- id - The ID of the Token. - -## Import - -Import is not supported for this resource. diff --git a/docs/resources/sonarqube_permission_template.md b/docs/resources/sonarqube_permission_template.md deleted file mode 100644 index 6a46d831..00000000 --- a/docs/resources/sonarqube_permission_template.md +++ /dev/null @@ -1,37 +0,0 @@ -# sonarqube_permission_template - -Provides a Sonarqube Permission template resource. This can be used to create and manage Sonarqube Permission -templates. - -## Example: create a template - -```terraform -resource "sonarqube_permission_template" "template" { - name = "Internal-Projects" - description = "These are internal projects" - project_key_pattern = "internal.*" -} -``` - -## Argument Reference - -The following arguments are supported: - -- name - (Required) The name of the Permission template to create. Do not use names with `/`. If needed, use `replace(var.permission_template_name, "/", "_")`. Changing this forces a new resource to be created. -- description - (Optional) Description of the Template. -- project_key_pattern - (Optional) The project key pattern. Must be a valid Java regular expression. -- default - (Optional) Set the template as the default. This can only be set for one template. - -## Attributes Reference - -The following attributes are exported: - -- id - The ID of the Permission template. - -## Import - -Templates can be imported using their ID - -```terraform -terraform import sonarqube_permission_template.template ABC_defghij -``` diff --git a/docs/resources/sonarqube_permissions.md b/docs/resources/sonarqube_permissions.md deleted file mode 100644 index 5112a8e8..00000000 --- a/docs/resources/sonarqube_permissions.md +++ /dev/null @@ -1,65 +0,0 @@ -# sonarqube_permissions - -Provides a Sonarqube Permissions resource. This can be used to manage global and project permissions. - -## Example: Set global admin permissions for a group called "my-admins" - -```terraform -resource "sonarqube_permissions" "my_global_admins" { - group_name = "my-admins" - permissions = ["admin"] -} -``` - -## Example: Set project admin permissions for a group called "my-project-admins" - -```terraform -resource "sonarqube_permissions" "my_project_admins" { - group_name = "my-project-admins" - project_key = "my-project" - permissions = ["admin"] -} -``` - -## Example: Set project admin permissions for a group called "my-project-admins on a permission template" - -```terraform -resource "sonarqube_permissions" "internal_admins" { - group_name = "my-internal-admins" - template_id = sonarqube_permission_template.template.id - permissions = ["admin"] -} -``` - -## Example: Set codeviewer & user permissions on project level for a user called "johndoe" - -```terraform -resource "sonarqube_permissions" "john_project_read" { - login_name = "johndoe" - project_key = "my-project" - permissions = ["codeviewer", "user"] -} -``` - -## Argument Reference - -The following arguments are supported: - -- login_name - (Optional) The name of the user that should get the specified permissions. Changing this forces a new resource to be created. Cannot be used with `group_name` -- group_name - (Optional) The name of the Group that should get the specified permissions. Changing this forces a new resource to be created. Cannot be used with `login_name` -- project_key - (Optional) Specify if you want to apply project level permissions. Changing this forces a new resource to be created. Cannot be used with `template_id & template_name` -- template_id - (Optional) Specify if you want to apply the permissions to a permission template. Changing this forces a new resource to be created. Cannot be used with `project_key & template_name` -- template_name - (Optional) Specify if you want to apply the permissions to a permission template. Changing this forces a new resource to be created. Cannot be used with `project_key & template_id` -- permissions - (Required) A list of permissions that should be applied. Changing this forces a new resource to be created. Possible values are: `admin`, `codeviewer`, `issueadmin`, `securityhotspotadmin`, `scan`, `user`. - -**Note:** To prevent unwanted diffs, you should sort the permissions alphabetically. - -## Attributes Reference - -The following attributes are exported: - -- id - A randomly generated UUID for the permission entry. - -## Import - -Importing is not supported for the `sonarqube_permissions` resource. diff --git a/docs/resources/sonarqube_plugin.md b/docs/resources/sonarqube_plugin.md deleted file mode 100644 index b8ccb872..00000000 --- a/docs/resources/sonarqube_plugin.md +++ /dev/null @@ -1,28 +0,0 @@ -# sonarqube_plugin -Provides a Sonarqube Plugin resource. This can be used to create and manage Sonarqube Plugins. - -## Example: create a project -```terraform -resource "sonarqube_plugin" "main" { - key = "cloudformation" -} -``` - -## Argument Reference -The following arguments are supported: - -- key - (Required) The key identifying the plugin to uninstall - -## Attributes Reference -The following attributes are exported: -- key - (Required) The key identifying the plugin to uninstall - -## Import -Projects can be imported using their plugin key - -```terraform -terraform import sonarqube_plugin.main key -``` - -## Notes -After installing or uninstalling a plugin, the sonarqube server needs to be restarted. \ No newline at end of file diff --git a/docs/resources/sonarqube_portfolio.md b/docs/resources/sonarqube_portfolio.md deleted file mode 100644 index 66617af2..00000000 --- a/docs/resources/sonarqube_portfolio.md +++ /dev/null @@ -1,65 +0,0 @@ -# sonarqube_portfolio -Provides a Sonarqube Portfolio resource. This can be used to create and manage Sonarqube Portfolio. Note that the SonarQube API for Portfolios is called ``views`` - -## Example: create a portfolio -```terraform -resource "sonarqube_portfolio" "main" { - key = "portfolio-key" - name = "portfolio-name" - description = "portfolio-description" -} -``` - -## Argument Reference -The following arguments are supported: - -- key - (Required) The key of the Portfolio to create -- name - (Required) The name of the Portfolio to create -- description - (Required) A description of the Portfolio to create -- visibility - (Optional) Whether the created portfolio should be visible to everyone, or only specific user/groups. If no visibility is specified, the default portfolio visibility will be `public`. -- selection_mode - (Optional) How to populate the Portfolio to create. Possible values are ``NONE``, ``MANUAL``, ``TAGS``, ``REGEXP`` or ``REST``. [See docs](https://docs.sonarqube.org/9.8/project-administration/managing-portfolios/#populating-portfolios) for how Portfolio population works -- branch - (Optional) Which branch to analyze. If nothing, or "" is specified, the main branch is used. -- tags - (Optional) List of Project tags to populate the Portfolio from. Only active when `selection_mode` is `TAGS` -- regexp - (Optional) A regular expression that is used to match Projects with a matching name OR key. If they match, they are added to the Portfolio -- ``selected_projects`` - (Optional) Block set of projects to add to the portfolio. Only active when `selection_mode` is `MANUAL`. See [below for nested schema](#selected_projects) - -### selected_projects - -The `selected_projects` block supports the following: - -* `project_key` - (Required) The key of a project to add to the portfolio -* `selected_branches` (Optional) A list of branches of the project to add to the portfolio. Defaults to the `MAIN BRANCH` of the repo if omitted - -Here is an example of how this option can be leveraged: - -```terraform -data "github_repositories" "repos" { - query = "org:my-cool-org topic:my-cool-topic language:go" -} - -resource "sonarqube_portfolio" "portfolio" { - key = "my-cool-portfolio" - name = "my-cool-portfolio" - description = "my-cool-portfolio" - selection_mode = "MANUAL" - dynamic "selected_projects" { - for_each = toset(data.github_repositories.repos.names) - content { - project_key = selected_projects.value - } - } -} -``` - -## Attributes Reference -The following attributes are exported in addition to the arguments above: -- qualifier - (Computed) Key of the portfolio (`VW` for views) -- projects - (Computed) List of projects in the portfolio (only when `selection_mode` is `MANUAL`) - -## Import -Portfolios can be imported using their portfolio key - -```terraform -terraform import sonarqube_portfolio.main my_portfolio -``` - diff --git a/docs/resources/sonarqube_project.md b/docs/resources/sonarqube_project.md deleted file mode 100644 index 58e624a4..00000000 --- a/docs/resources/sonarqube_project.md +++ /dev/null @@ -1,55 +0,0 @@ -# sonarqube_project -Provides a Sonarqube Project resource. This can be used to create and manage Sonarqube Project. - -## Example: create a project -```terraform -resource "sonarqube_project" "main" { - name = "SonarQube" - project = "my_project" - visibility = "public" -} -``` - -## Example: a project with associated settings -```terraform -resource "sonarqube_project" "main" { - name = "SonarQube" - project = "my_project" - visibility = "public" - - setting { - key = "sonar.demo" - value = "sonarqube@example.org" - } -} -``` - -## Argument Reference -The following arguments are supported: - -- name - (Required) The name of the Project to create -- project - (Required) Key of the project. Maximum length 400. All letters, digits, dash, underscore, period or colon. -- visibility - (Optional) Whether the created project should be visible to everyone, or only specific user/groups. If no visibility is specified, the default project visibility of the organization will be used. Valid values are `public` and `private`. -- tags - (Optional) A list of tags to put on the project. -- setting - (Optional) The definition of a Setting to be used by this Portfolio as documented in the `setting` block below. - -A `setting` block supports: - -- key - (Required) Setting key -- value - (Optional) Single valued setting value -- values - (Optional) Multi-valued setting values -- field_values - (Optional) Multi-field setting values - -One of value, values, field_values _must_ be supplied - -## Attributes Reference -The following attributes are exported: -- project - (Required) Key of the project - -## Import -Projects can be imported using their project key - -```terraform -terraform import sonarqube_project.main my_project -``` - diff --git a/docs/resources/sonarqube_project_main_branch.md b/docs/resources/sonarqube_project_main_branch.md deleted file mode 100644 index 300cd171..00000000 --- a/docs/resources/sonarqube_project_main_branch.md +++ /dev/null @@ -1,34 +0,0 @@ -# sonarqube_project_main_branch -Provides a Sonarqube Project main branch resource. This can be used to create and manage a Sonarqube Projects main branch. - -## Example: Change the name of the main branch -```terraform -resource "sonarqube_project" "main" { - name = "SonarQube" - project = "my_project" - visibility = "public" -} -resource "sonarqube_project_main_branch" "mybranch" { - name = "release" - project = "my_project" -} -``` - -## Argument Reference -The following arguments are supported: - -- name - (Required) The name you want the main branch to have. -- project - (Required) Key of the project. Maximum length 400. All letters, digits, dash, underscore, period or colon. - -## Attributes Reference -The following attributes are exported: -- name - The name of the main branch -- project - Key of the project - -## Import - -Main branch can be imported using their ID - -```terraform -terraform import sonarqube_project_main_branch.mybranch project/name -``` \ No newline at end of file diff --git a/docs/resources/sonarqube_qualitygate.md b/docs/resources/sonarqube_qualitygate.md deleted file mode 100644 index 5b56c742..00000000 --- a/docs/resources/sonarqube_qualitygate.md +++ /dev/null @@ -1,83 +0,0 @@ -# sonarqube_qualitygate - -Provides a Sonarqube Quality Gate resource. This can be used to create and manage Sonarqube Quality Gates and their Conditions. - -## Example: create a quality gate - -```terraform -resource "sonarqube_qualitygate" "main" { - name = "example" - is_default = true - - condition { - metric = "new_coverage" - op = "LT" - threshold = "50" - } - - condition { - metric = "vulnerabilities" - threshold = "10" - op = "GT" - } -} -``` - -## Argument Reference - -The following arguments are supported: - -- name - (Required) The name of the Quality Gate to create. Maximum length 100 -- copy_from - (Optional) Name of an existing Quality Gate to copy from -- is_default - (Optional) When set to true this will make the added Quality Gate default -- condition - (Required) The definition of a Condition to be used by this Quality Gate as documented in the `condition` block below. At least one condition is required for a Quality Gate. - -A `condition` block supports: - -- metric - (Required) Condition metric. - - Only metrics of the following types are allowed: - - INT - - MILLISEC - - RATING - - WORK_DUR - - FLOAT - - PERCENT - - LEVEL. - - The following metrics are forbidden: - - alert_status - - security_hotspots - - new_security_hotspots - -- threshold - (Required) Condition error threshold (For ratings: A=1, B=2, C=3, D=4) -- op - (Required) Condition operator. Possible values are: LT and GT - -**Disclaimer: Operator Requirement for Grade Rating Conditions** - -When working with grade rating conditions, (A-D), it is important to note that the "GT" (greater than) operator must be used for the `op` field. This is due to SonarQube's API design. More information can be found in this [issue](https://github.com/jdamata/terraform-provider-sonarqube/issues/171). - -For example, if you are using a grade rating metric such as `new_reliability_rating`, where A represents the highest rating and subsequent letters represent lower ratings, you need to supply the `op` field with "GT" via the provider. Using "LT" will return an error from SonarQube's API: - -```terraform - condition { - metric = "new_reliability_rating" - op = "GT" - threshold = "1" - } -``` - -## Attributes Reference - -The following attributes are exported: - -- name - Name of the Sonarqube Quality Gate -- id - ID of the Sonarqube Quality Gate (Deprecated in SonarQube 8.4 and removed in 10.0 so recommended you do not rely on this) - -## Import - -Quality Gates can be imported using its name - -```terraform -terraform import sonarqube_qualitygate.main my-cool-gate -``` diff --git a/docs/resources/sonarqube_qualitygate_project_association.md b/docs/resources/sonarqube_qualitygate_project_association.md deleted file mode 100644 index 03ba0001..00000000 --- a/docs/resources/sonarqube_qualitygate_project_association.md +++ /dev/null @@ -1,39 +0,0 @@ -# sonarqube_qualitygate_project_association -Provides a Sonarqube Quality Gate Project association resource. This can be used to associate a Quality Gate to a Project - -## Example: create a quality gate project association -```terraform -resource "sonarqube_qualitygate" "main" { - name = "my_qualitygate" - - condition { - metric = "new_coverage" - op = "LT" - threshold = "30" - } -} - -resource "sonarqube_project" "main" { - name = "SonarQube" - project = "my_project" - visibility = "public" -} - -resource "sonarqube_qualitygate_project_association" "main" { - gatename = sonarqube_qualitygate.main.id - projectkey = sonarqube_project.main.project -} -``` - -## Argument Reference -The following arguments are supported: - -- gatename - (Required) The name of the Quality Gate -- projectkey - (Required) Key of the project. Maximum length 400. All letters, digits, dash, underscore, period or colon. - -## Import -Quality Gates Project Associations can be imported using a combination of quality gate name and project key - -```terraform -terraform import sonarqube_qualitygate_project_association.main my_qualitygate/my_project -``` \ No newline at end of file diff --git a/docs/resources/sonarqube_qualitygate_usergroup_association.md b/docs/resources/sonarqube_qualitygate_usergroup_association.md deleted file mode 100644 index f3e037ab..00000000 --- a/docs/resources/sonarqube_qualitygate_usergroup_association.md +++ /dev/null @@ -1,68 +0,0 @@ -# sonarqube_qualitygate_usergroup_association - -Provides a Sonarqube Quality Gate Usergroup association resource. This can be used to associate a Quality Gate to an User or to a Group. -The feature is available on SonarQube 9.2 or newer. - -## Example: create a quality gate group association -```terraform -resource "sonarqube_qualitygate" "main" { - name = "my_qualitygate" - - condition { - metric = "new_coverage" - op = "LT" - threshold = "30" - } -} - -resource "sonarqube_group" "qa_team" { - name = "QA-Team" - description = "Quality Assurence Team" -} - -resource "sonarqube_qualitygate_usergroup_association" "main" { - gatename = sonarqube_qualitygate.main.id - group_name = sonarqube_group.qa_team.name -} -``` - -## Example: create a quality gate user association -```terraform -resource "sonarqube_qualitygate" "main" { - name = "my_qualitygate" - - condition { - metric = "new_coverage" - op = "LT" - threshold = "30" - } -} - -resource "sonarqube_user" "qa_user" { - login_name = "qa-user" - name = "qa-user" - password = "secret-sauce37!" -} - -resource "sonarqube_qualitygate_usergroup_association" "main" { - gatename = sonarqube_qualitygate.main.id - login_name = sonarqube_user.qa_user.id -} -``` - -## Argument Reference -The following arguments are supported: - -- `gatename` - (Required) The name of the Quality Gate -- `group_name` - (Optional) The name of the Group to associate. Either `group_name` or `login_name` should be provided. -- `login_name` - (Optional) The name of the User to associate. Either `group_name` or `login_name` should be provided. - -## Attributes Reference - -The following attributes are exported: - -- `id` - A quality user/group composed ID for the association entry. - -## Import - -Import is not required because SonarQube overwrites existing associations. \ No newline at end of file diff --git a/docs/resources/sonarqube_qualityprofile.md b/docs/resources/sonarqube_qualityprofile.md deleted file mode 100644 index dc2fa091..00000000 --- a/docs/resources/sonarqube_qualityprofile.md +++ /dev/null @@ -1,34 +0,0 @@ -# sonarqube_qualityprofile -Provides a Sonarqube Quality Profile resource. This can be used to create and manage Sonarqube Quality Profiles. - -## Example: create a quality profile -```terraform -resource "sonarqube_qualityprofile" "main" { - name = "example" - language = "js" - is_default = false - parent = "sonar way" -} -``` - -## Argument Reference -The following arguments are supported: - -- name - (Required) The name of the Quality Profile to create. Maximum length 100 -- language - (Required) Quality profile language. Must be one of "cs", "css", "flex", "go", "java", "js", "jsp", "kotlin", "php", "py", "ruby", "scala", "ts", "vbnet", "web", "xml" -- is_default - (Optional) When set to true this will make the added Quality Profile default -- parent - (Optional) When a parent is provided the quality profile will inherit it's rules - -## Attributes Reference -The following attributes are exported: - -- name - Name of the Sonarqube Quality Profile -- id - ID of the Sonarqube Quality Profile -- key - ID of the Sonarqube Quality Profile - -## Import -Quality Profiles can be imported using their ID - -```terraform -terraform import sonarqube_qualityprofile.main AU-Tpxb--iU5OvuD2FLy -``` \ No newline at end of file diff --git a/docs/resources/sonarqube_qualityprofile_activate_rule.md b/docs/resources/sonarqube_qualityprofile_activate_rule.md deleted file mode 100644 index ca53a426..00000000 --- a/docs/resources/sonarqube_qualityprofile_activate_rule.md +++ /dev/null @@ -1,51 +0,0 @@ -# sonarqube_qualityprofile_activate_rule - -Provides a Sonarqube Rules resource. This can be used to manage Sonarqube rules. - -## Example: activate a rule - -```terraform - -resource "sonarqube_rule" "allowed_maven_dependencies" { - custom_key = "Only_use_allowed_Maven_dependencies" - markdown_description = "Description" - name = "Only use allowed Maven dependencies" - params = "FilePattern=**/pom.xml" - severity = "BLOCKER" - status = "READY" - template_key = "xml:XPathCheck" - type = "VULNERABILITY" -} - -resource "sonarqube_qualityprofile" "xml" { - name = "test way - xml" - language = "xml" - is_default = "false" - parent = "Sonar way" -} - -resource "sonarqube_qualityprofile_activate_rule" "xml_rule" { - key = sonarqube_qualityprofile.xml.key # .id also works - rule = sonarqube_rule.allowed_maven_dependencies.id - severity = "BLOCKER" -} - -``` - -## Argument Reference - -The following arguments are supported - -- key - (Required) Quality Profile key. Can be obtained through api/qualityprofiles/search -- params - (Optional) Parameters as semi-colon list of key=value. Ignored if parameter reset is true. -- reset - (Optional) Reset severity and parameters of activated rule. Set the values defined on parent profile or from rule default values. - - Possible values true false yes no (Default false) -- rule - Rule key -- severity - (Optional) Severity. Ignored if parameter reset is true. - - Possible values - INFO, MINOR, MAJOR, CRITICAL, BLOCKER - -## Attribute Reference - -The following attributes are exported: - -- key - the Key of the Rule. diff --git a/docs/resources/sonarqube_qualityprofile_project_association.md b/docs/resources/sonarqube_qualityprofile_project_association.md deleted file mode 100644 index cb207423..00000000 --- a/docs/resources/sonarqube_qualityprofile_project_association.md +++ /dev/null @@ -1,36 +0,0 @@ -# sonarqube_qualityprofile_project_association -Provides a Sonarqube Quality Profile Project association resource. This can be used to associate a Quality Profile to a Project - -## Example: create a quality profile project association -```terraform -resource "sonarqube_qualityprofile" "main" { - name = "my_quality_profile" - language = "js" -} - -resource "sonarqube_project" "main" { - name = "SonarQube" - project = "my_project" - visibility = "public" -} - -resource "sonarqube_qualityprofile_project_association" "main" { - quality_profile = sonarqube_qualityprofile.main.name - project = sonarqube_project.main.project - language = "js" -} -``` - -## Argument Reference -The following arguments are supported: - -- quality_profile - (Required) Name of the Quality Profile -- project - (Required) Name of the project -- language - (Required) Quality profile language. Must be a langauge in this list https://next.sonarqube.com/sonarqube/web_api/api/languages/list - -## Import -Quality Profiles Project Associations can be imported using a combination of quality profile name, project name and language - -```terraform -terraform import sonarqube_qualityprofile_project_association.main my_quality_profile/SonarQube/js -``` \ No newline at end of file diff --git a/docs/resources/sonarqube_rules.md b/docs/resources/sonarqube_rules.md deleted file mode 100644 index 125bae69..00000000 --- a/docs/resources/sonarqube_rules.md +++ /dev/null @@ -1,47 +0,0 @@ -# sonarqube_rules - -Provides a Sonarqube Rules resource. This can be used to manage Sonarqube rules. - -## Example: create a rule - -```terraform -resource "sonarqube_rule" "rule" { - key = "rule_test" - markdown_description = "Description of my rule" - name = "rule test" - params = "FilePattern=**/pom.xml" - prevent_reactivation = "false" - severity = "CRITICAL" - status = "READY" - template_key = "xml:XPathCheck" - type = "VULNERABILITY" -} - -``` - -## Argument Reference - -The following arguments are supported - -- key - (Required) key of the custom rule should only contain : a-z, 0-9, _ -- markdown_description - (Required) Rule description -- name - (Required) Rule name -- params - (Optional) Parameters as semi-colon list of =, for example 'params=key1=v1;key2=v2' (Only for custom rule) - - parameter order: expression=value;filePattern=value;message=value -- prevent_reactivation - (Optional) If set to true and if the rule has been deactivated (status 'REMOVED'), a status 409 will be returned - - Possible values - true, false, yes, no -- severity - (Optional) Rule severity - - Possible values - INFO, MINOR, MAJOR, CRITICAL, BLOCKER -- status - (Optional) Rule status - - Possible values - BETA, DEPRECATED, READY, REMOVED - - Default value READY -- template_key - Key of the template rule in order to create a custom rule (mandatory for custom rule) - - [Example values](https://docs.sonarqube.org/latest/user-guide/rules/#header-4) -- type - (Optional) Rule type - - Possible values - CODE_SMELL, BUG, VULNERABILITY, SECURITY_HOTSPOT - -## Attribute Reference - -The following attributes are exported: - -- key - The Key of the Rule. diff --git a/docs/resources/sonarqube_settings.md b/docs/resources/sonarqube_settings.md deleted file mode 100644 index 6e932327..00000000 --- a/docs/resources/sonarqube_settings.md +++ /dev/null @@ -1,52 +0,0 @@ -# sonarqube_settings - -Provides a Sonarqube Settings resource. This can be used to manage Sonarqube settings. - -## Example: create a setting with a single value - -```terraform -resource "sonarqube_setting" "single_setting" { - key = "sonar.demo" - value = "sonarqube@example.org" -} - -``` - -## Example: create a setting with multiple values -```terraform -resource "sonarqube_setting" "multi_value_setting" { - key = "sonar.global.exclusions" - values = ["foo", "bar/**/*.*"] -} -``` -## Example: create a setting with multiple field values -```terraform -resource "sonarqube_setting" "multi_field_setting" { - key = "sonar.issue.ignore.multicriteria" - field_values = [ - { - "ruleKey" : "foo", - "resourceKey" : "bar" - }, - { - "ruleKey" : "foo2", - "resourceKey" : "bar2" - } - ] -} -``` -## Argument Reference - -The following arguments are supported - -- key - (Required) Setting key -- value - (Optional) Single valued setting value -- values - (Optional) Multi-valued setting values -- field_values - (Optional) Multi-field setting values - -One of value, values, field_values _must_ be supplied -## Attribute Reference - -The following attributes are exported: - -- key - The Key of the Setting. diff --git a/docs/resources/sonarqube_user.md b/docs/resources/sonarqube_user.md deleted file mode 100644 index 7355f64d..00000000 --- a/docs/resources/sonarqube_user.md +++ /dev/null @@ -1,52 +0,0 @@ -# sonarqube_user - -Provides a Sonarqube User resource. This can be used to manage Sonarqube Users. - -**Note**: By default Sonarqube only *deactivates* a user on `destroy` but keeps its personal data in the database. Since release `9.7` it -is possible to automatically anonymize the data. This can be helpful to comply with regulations like [GDPR](https://en.wikipedia.org/wiki/General_Data_Protection_Regulation). -This behaviour can be activated with the `anonymize_user_on_delete` flag on the `provider` configuration. - -## Example: create a local user - -```terraform -resource "sonarqube_user" "user" { - login_name = "terraform-test" - name = "terraform-test" - password = "secret-sauce37!" -} -``` - -## Example: create a remote user - -```terraform -resource "sonarqube_user" "remote_user" { - login_name = "terraform-test" - name = "terraform-test" - email = "terraform-test@sonarqube.com" - is_local = false -} -``` - -## Argument Reference - -The following arguments are supported: - -- login_name - (Required) The login name of the User to create. Changing this forces a new resource to be created. -- name - (Required) The name of the User to create. Changing this forces a new resource to be created. -- email - (Optional) The email of the User to create. -- password - (Optional) The password of User to create. This is only used if the user is of type `local`. -- is_local - (Optional) `True` if the User should be of type `local`. Defaults to `true`. - -## Attributes Reference - -The following attributes are exported: - -- id - The ID of the User. - -## Import - -Users can be imported using their `login_name`: - -```terraform -terraform import sonarqube_user.user terraform-test -``` diff --git a/docs/resources/sonarqube_user_external_identity.md b/docs/resources/sonarqube_user_external_identity.md deleted file mode 100644 index 97108862..00000000 --- a/docs/resources/sonarqube_user_external_identity.md +++ /dev/null @@ -1,33 +0,0 @@ -# sonarqube_user_external_entity - -Updates the *external identity* of a *non local* Sonarqube User. This can be used to set the *Identity Provider* which should be used to -authenticate a specific user. - -The Sonarqube API currently does not provide an endpoint to read the *external identity* setting of an user. - -## Example: change the external identity to SAML - -```terraform -resource "sonarqube_user" "remote_user" { - login_name = "terraform-test" - name = "terraform-test" - email = "terraform-test@sonarqube.com" - is_local = false -} - -resource "sonarqube_user_external_identity" "remote_user" { - login_name = sonarqube_user.remote_user.login_name - external_identity = "terraform-test@sonarqube.com" - external_provider = "saml" -} -``` - -## Argument Reference - -The following arguments are supported: - -- `login_name` - (Required) The login name of the User to update. Changing this forces a new resource to be created. -- `external_identity` - (Required) The identifier of the User used by the Authentication Provider. Changing this forces a new resource to be - created. -- `external_provider` - (Required) The key of the Authentication Provider. The Authentication Provider must be activated on Sonarqube. Changing - this forces a new resource to be created. diff --git a/docs/resources/sonarqube_user_token.md b/docs/resources/sonarqube_user_token.md deleted file mode 100644 index 033ad51d..00000000 --- a/docs/resources/sonarqube_user_token.md +++ /dev/null @@ -1,71 +0,0 @@ -# sonarqube_user_token - -Provides a Sonarqube User token resource. This can be used to manage Sonarqube User tokens. - -## Example: create a user, user token and output the token value - -```terraform -resource "sonarqube_user" "user" { - login_name = "terraform-test" - name = "terraform-test" - password = "secret-sauce37!" -} - -resource "sonarqube_user_token" "token" { - login_name = sonarqube_user.user.login_name - name = "my-token" -} - -output "user_token" { - value = sonarqube_user_token.token.token -} -``` - -## Example: create an expiring global analysis token and output the token value - -```terraform -resource "sonarqube_user_token" "token" { - name = "my-token" - type = "GLOBAL_ANALYSIS_TOKEN" - expiration_date = "2099-01-01" -} - -output "global_analysis_token" { - value = sonarqube_user_token.token.token -} -``` - -## Example: create a project, project analysis token, and output the token value - -```terraform -resource "sonarqube_user_token" "token" { - name = "my-token" - type = "PROJECT_ANALYSIS_TOKEN" - project_key = "my-project" -} - -output "project_analysis_token" { - value = sonarqube_user_token.token.token -} -``` - -## Argument Reference - -The following arguments are supported: - -- login_name - (Optional) The login name of the User for which the token should be created. If not set, the token is created for the authenticated user. Changing this forces a new resource to be created. -- name - (Required) The name of the Token to create. Changing this forces a new resource to be created. -- expiration_date - (Optional) The expiration date of the token being generated, in ISO 8601 format (YYYY-MM-DD). If not set, default to no expiration. -- type - (Optional) The kind of Token to create. Changing this forces a new resource to be created. Possible values are USER_TOKEN, GLOBAL_ANALYSIS_TOKEN, or PROJECT_ANALYSIS_TOKEN. Defaults to USER_TOKEN. If set to PROJECT_ANALYSIS_TOKEN, then the project_key must also be specified. -- project_key - (Optional) The key of the only project that can be analyzed by the PROJECT_ANALYSIS TOKEN being created. Changing this forces a new resource to be created. - -## Attributes Reference - -The following attributes are exported: - -- id - The ID of the Token. -- token - The Token value. - -## Import - -Import is not supported for this resource. diff --git a/docs/resources/sonarqube_webhook.md b/docs/resources/sonarqube_webhook.md deleted file mode 100644 index b31b3c50..00000000 --- a/docs/resources/sonarqube_webhook.md +++ /dev/null @@ -1,52 +0,0 @@ -# sonarqube_webhook - -Provides a Sonarqube Webhook resource. This can be used to manage Sonarqube webhooks. - -## Example: create a webhook - -```terraform -resource "sonarqube_webhook" "webhook" { - name = "terraform-webhook" - url = "https://my-webhook-destination.example.com" -} -``` - -## Example: create a webhook owned by a project - -```terraform -resource "sonarqube_project" "project" { - name = "project" - project = "project" - visibility = "public" -} - -resource "sonarqube_webhook" "webhook" { - name = "terraform-webhook" - url = "https://my-webhook-destination.example.com" - project = sonarqube_project.project.name -} -``` - -## Argument Reference - -The following arguments are supported: - -- name - (Required) The name of the webhook to create. This will be displayed in the Sonarqube administration console. -- url - (Required) The URL to send event payloads to. This must begin with either `https://` or `http://`. -- project - (Optional) The key of the project that will own the webhook. -- secret - (Optional) The secret to send with the event payload. - - -## Attributes Reference - -The following attributes are exported: - -- id - The ID (key) of the webhook. - -## Import - -Webhooks can be imported using their ID (key): - -```bash -terraform import sonarqube_webhook.webhook AXnN9NuxdWLvsEEPOr2g -``` diff --git a/docs/resources/user.md b/docs/resources/user.md new file mode 100644 index 00000000..fc05b8f6 --- /dev/null +++ b/docs/resources/user.md @@ -0,0 +1,48 @@ +--- +page_title: "sonarqube_user Resource - terraform-provider-sonarqube" +subcategory: "" +description: |- + Provides a Sonarqube User resource. This can be used to manage Sonarqube Users. +--- + +# sonarqube_user (Resource) + +Provides a Sonarqube User resource. This can be used to manage Sonarqube Users. + +## Example Usage +### Example: create a local user +```terraform +resource "sonarqube_user" "user" { + login_name = "terraform-test" + name = "terraform-test" + password = "secret-sauce37!" +} +``` + +### Example: create a remote user +```terraform +resource "sonarqube_user" "remote_user" { + login_name = "terraform-test" + name = "terraform-test" + email = "terraform-test@sonarqube.com" + is_local = false +} +``` + + +## Schema + +### Required + +- `login_name` (String) The login name of the User to create. Changing this forces a new resource to be created. +- `name` (String) The name of the User to create. Changing this forces a new resource to be created. + +### Optional + +- `email` (String) The email of the User to create. +- `is_local` (Boolean) `True` if the User should be of type `local`. Defaults to `true`. +- `password` (String, Sensitive) The password of User to create. This is only used if the user is of type `local`. + +### Read-Only + +- `id` (String) The ID of this resource. diff --git a/docs/resources/user_external_identity.md b/docs/resources/user_external_identity.md new file mode 100644 index 00000000..73700c4b --- /dev/null +++ b/docs/resources/user_external_identity.md @@ -0,0 +1,48 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "sonarqube_user_external_identity Resource - terraform-provider-sonarqube" +subcategory: "" +description: |- + Updates the external identity of a non local Sonarqube User. This can be used to set the Identity Provider which should be used to + authenticate a specific user. + The Sonarqube API currently does not provide an endpoint to read the external identity setting of an user. +--- + +# sonarqube_user_external_identity (Resource) + +Updates the _external identity_ of a _non local_ Sonarqube User. This can be used to set the _Identity Provider_ which should be used to +authenticate a specific user. + +The Sonarqube API currently does not provide an endpoint to read the _external identity_ setting of an user. + +## Example Usage + +```terraform +## Example: change the external identity to SAML + +resource "sonarqube_user" "remote_user" { + login_name = "terraform-test" + name = "terraform-test" + email = "terraform-test@sonarqube.com" + is_local = false +} + +resource "sonarqube_user_external_identity" "remote_user" { + login_name = sonarqube_user.remote_user.login_name + external_identity = "terraform-test@sonarqube.com" + external_provider = "saml" +} +``` + + +## Schema + +### Required + +- `external_identity` (String) The identifier of the User used by the Authentication Provider. Changing this forces a new resource to be created. +- `external_provider` (String) The key of the Authentication Provider. The Authentication Provider must be activated on Sonarqube. Changing this forces a new resource to be created. +- `login_name` (String) The login name of the User to update. Changing this forces a new resource to be created. + +### Read-Only + +- `id` (String) The ID of this resource. diff --git a/docs/resources/user_token.md b/docs/resources/user_token.md new file mode 100644 index 00000000..fd5668ba --- /dev/null +++ b/docs/resources/user_token.md @@ -0,0 +1,74 @@ +--- +page_title: "sonarqube_user_token Resource - terraform-provider-sonarqube" +subcategory: "" +description: |- + Provides a Sonarqube User token resource. This can be used to manage Sonarqube User tokens. +--- + +# sonarqube_user_token (Resource) + +Provides a Sonarqube User token resource. This can be used to manage Sonarqube User tokens. + +## Example Usage +### Example: create a user, user token and output the token value +```terraform +resource "sonarqube_user" "user" { + login_name = "terraform-test" + name = "terraform-test" + password = "secret-sauce37!" +} + +resource "sonarqube_user_token" "token" { + login_name = sonarqube_user.user.login_name + name = "my-token" +} + +output "user_token" { + value = sonarqube_user_token.token.token +} +``` + +### Example: create an expiring global analysis token and output the token value +```terraform +resource "sonarqube_user_token" "token" { + name = "my-token" + type = "GLOBAL_ANALYSIS_TOKEN" + expiration_date = "2099-01-01" +} + +output "global_analysis_token" { + value = sonarqube_user_token.token.token +} +``` + +### Example: create a project, project analysis token, and output the token value +```terraform +resource "sonarqube_user_token" "token" { + name = "my-token" + type = "PROJECT_ANALYSIS_TOKEN" + project_key = "my-project" +} + +output "project_analysis_token" { + value = sonarqube_user_token.token.token +} +``` + + +## Schema + +### Required + +- `name` (String) The name of the Token to create. Changing this forces a new resource to be created. + +### Optional + +- `expiration_date` (String) The expiration date of the token being generated, in ISO 8601 format (YYYY-MM-DD). If not set, default to no expiration. +- `login_name` (String) The login name of the User for which the token should be created. If not set, the token is created for the authenticated user. Changing this forces a new resource to be created. +- `project_key` (String) The key of the only project that can be analyzed by the PROJECT_ANALYSIS TOKEN being created. Changing this forces a new resource to be created. +- `type` (String) The kind of Token to create. Changing this forces a new resource to be created. Possible values are USER_TOKEN, GLOBAL_ANALYSIS_TOKEN, or PROJECT_ANALYSIS_TOKEN. Defaults to USER_TOKEN. If set to PROJECT_ANALYSIS_TOKEN, then the project_key must also be specified. + +### Read-Only + +- `id` (String) The ID of this resource. +- `token` (String, Sensitive) The token value. diff --git a/docs/resources/webhook.md b/docs/resources/webhook.md new file mode 100644 index 00000000..ecd1f97a --- /dev/null +++ b/docs/resources/webhook.md @@ -0,0 +1,51 @@ +--- +page_title: "sonarqube_webhook Resource - terraform-provider-sonarqube" +subcategory: "" +description: |- + Provides a Sonarqube Webhook resource. This can be used to manage Sonarqube webhooks. +--- + +# sonarqube_webhook (Resource) + +Provides a Sonarqube Webhook resource. This can be used to manage Sonarqube webhooks. + +## Example Usage +### Example: create a webhook +```terraform +resource "sonarqube_webhook" "webhook" { + name = "terraform-webhook" + url = "https://my-webhook-destination.example.com" +} +``` + +### Example: create a webhook owned by a project +```terraform +resource "sonarqube_project" "project" { + name = "project" + project = "project" + visibility = "public" +} + +resource "sonarqube_webhook" "webhook" { + name = "terraform-webhook" + url = "https://my-webhook-destination.example.com" + project = sonarqube_project.project.name +} +``` + + +## Schema + +### Required + +- `name` (String) The name of the webhook to create. This will be displayed in the Sonarqube administration console. +- `url` (String) The URL to send event payloads to. This must begin with either `https://` or `http://`. + +### Optional + +- `project` (String) The key of the project that will own the webhook. +- `secret` (String, Sensitive) The secret to send with the event payload. + +### Read-Only + +- `id` (String) The ID of this resource. diff --git a/examples/data-sources/sonarqube_group/data-source.tf b/examples/data-sources/sonarqube_group/data-source.tf new file mode 100644 index 00000000..4067d4a4 --- /dev/null +++ b/examples/data-sources/sonarqube_group/data-source.tf @@ -0,0 +1,3 @@ +data "sonarqube_group" "group" { + name = "terraform-test" +} diff --git a/examples/data-sources/sonarqube_portfolio/data-source.tf b/examples/data-sources/sonarqube_portfolio/data-source.tf new file mode 100644 index 00000000..ca0bf955 --- /dev/null +++ b/examples/data-sources/sonarqube_portfolio/data-source.tf @@ -0,0 +1,3 @@ +data "sonarqube_portfolio" "portfolio" { + key = "portfolio-key" +} diff --git a/examples/data-sources/sonarqube_project/data-source.tf b/examples/data-sources/sonarqube_project/data-source.tf new file mode 100644 index 00000000..5a1846e0 --- /dev/null +++ b/examples/data-sources/sonarqube_project/data-source.tf @@ -0,0 +1,3 @@ +data "sonarqube_project" "project" { + project = "projet-key-id" +} diff --git a/examples/data-sources/sonarqube_qualitygate/data-source.tf b/examples/data-sources/sonarqube_qualitygate/data-source.tf new file mode 100644 index 00000000..a41e3f2b --- /dev/null +++ b/examples/data-sources/sonarqube_qualitygate/data-source.tf @@ -0,0 +1,3 @@ +data "sonarqube_qualitygate" "main" { + name = "example" +} diff --git a/examples/data-sources/sonarqube_qualityprofile/data-source.tf b/examples/data-sources/sonarqube_qualityprofile/data-source.tf new file mode 100644 index 00000000..85c9212d --- /dev/null +++ b/examples/data-sources/sonarqube_qualityprofile/data-source.tf @@ -0,0 +1,3 @@ +data "sonarqube_qualityprofile" "main" { + name = "example" +} diff --git a/examples/data-sources/sonarqube_rule/data-source.tf b/examples/data-sources/sonarqube_rule/data-source.tf new file mode 100644 index 00000000..5479c7f5 --- /dev/null +++ b/examples/data-sources/sonarqube_rule/data-source.tf @@ -0,0 +1,3 @@ +data "sonarqube_rule" "rule" { + key = "squid:forbidSonar" +} diff --git a/examples/data-sources/sonarqube_user/data-source.tf b/examples/data-sources/sonarqube_user/data-source.tf new file mode 100644 index 00000000..00a24669 --- /dev/null +++ b/examples/data-sources/sonarqube_user/data-source.tf @@ -0,0 +1,3 @@ +data "sonarqube_user" "user" { + login_name = "terraform-test" +} diff --git a/examples/provider/provider.tf b/examples/provider/provider.tf new file mode 100644 index 00000000..91f3a4af --- /dev/null +++ b/examples/provider/provider.tf @@ -0,0 +1,30 @@ +## Example: Authenticate with username and password + +terraform { + required_providers { + sonarqube = { + source = "jdamata/sonarqube" + } + } +} + +provider "sonarqube" { + user = "admin" + pass = "admin" + host = "http://127.0.0.1:9000" +} + +## Example: Authenticate with token + +terraform { + required_providers { + sonarqube = { + source = "jdamata/sonarqube" + } + } +} + +provider "sonarqube" { + token = "d4at55a6f7r199bd707h39625685510880gbf7ff" + host = "http://127.0.0.1:9000" +} diff --git a/examples/resources/sonarqube_alm_azure/resource.tf b/examples/resources/sonarqube_alm_azure/resource.tf new file mode 100644 index 00000000..3cde1b32 --- /dev/null +++ b/examples/resources/sonarqube_alm_azure/resource.tf @@ -0,0 +1,5 @@ +resource "sonarqube_alm_azure" "az1" { + key = "az1" + personal_access_token = "my_pat" + url = "https://dev.azure.com/my-org" +} diff --git a/examples/resources/sonarqube_alm_github/resource.tf b/examples/resources/sonarqube_alm_github/resource.tf new file mode 100644 index 00000000..d93741e6 --- /dev/null +++ b/examples/resources/sonarqube_alm_github/resource.tf @@ -0,0 +1,9 @@ +resource "sonarqube_alm_github" "github-alm" { + app_id = "12345" + client_id = "56789" + client_secret = "secret" + key = "myalm" + private_key = "myprivate_key" + url = "https://api.github.com" + webhook_secret = "mysecret" +} diff --git a/examples/resources/sonarqube_alm_gitlab/resource.tf b/examples/resources/sonarqube_alm_gitlab/resource.tf new file mode 100644 index 00000000..877a6808 --- /dev/null +++ b/examples/resources/sonarqube_alm_gitlab/resource.tf @@ -0,0 +1,5 @@ +resource "sonarqube_alm_gitlab" "gitlab-alm" { + key = "myalm" + personal_access_token = "my_personal_access_token" + url = "https://gitlab.com/api/v4" +} diff --git a/examples/resources/sonarqube_azure_binding/resource.tf b/examples/resources/sonarqube_azure_binding/resource.tf new file mode 100644 index 00000000..87d732e7 --- /dev/null +++ b/examples/resources/sonarqube_azure_binding/resource.tf @@ -0,0 +1,18 @@ +resource "sonarqube_alm_azure" "az1" { + key = "az1" + personal_access_token = "my_pat" + url = "https://dev.azure.com/my-org" +} + +resource "sonarqube_project" "main" { + name = "SonarQube" + project = "main" + visibility = "public" +} + +resource "sonarqube_azure_binding" "main" { + alm_setting = sonarqube_alm_azure.az1.key + project = sonarqube_project.main.project + project_name = "my_azure_project" + repository_name = "my_repo" +} diff --git a/examples/resources/sonarqube_github_binding/resource.tf b/examples/resources/sonarqube_github_binding/resource.tf new file mode 100644 index 00000000..02e939da --- /dev/null +++ b/examples/resources/sonarqube_github_binding/resource.tf @@ -0,0 +1,20 @@ +resource "sonarqube_alm_github" "github-alm" { + app_id = "12345" + client_id = "56789" + client_secret = "secret" + key = "myalm" + private_key = "myprivate_key" + url = "https://api.github.com" + webhook_secret = "mysecret" +} + +resource "sonarqube_project" "main" { + name = "SonarQube" + project = "my_project" + visibility = "public" +} +resource "sonarqube_github_binding" "github-binding" { + alm_setting = sonarqube_alm_github.github-alm.key + project = "my_project" + repository = "myorg/myrepo" +} diff --git a/examples/resources/sonarqube_gitlab_binding/resource.tf b/examples/resources/sonarqube_gitlab_binding/resource.tf new file mode 100644 index 00000000..af00e710 --- /dev/null +++ b/examples/resources/sonarqube_gitlab_binding/resource.tf @@ -0,0 +1,17 @@ +resource "sonarqube_alm_gitlab" "gitlab-alm" { + key = "myalm" + personal_access_token = "my_personal_access_token" + url = "https://gitlab.com/api/v4" +} + +resource "sonarqube_project" "main" { + name = "SonarQube" + project = "my_project" + visibility = "public" +} + +resource "sonarqube_gitlab_binding" "gitlab-binding" { + alm_setting = sonarqube_alm_gitlab.gitlab-alm.key + project = "my_project" + repository = "123" +} diff --git a/examples/resources/sonarqube_group/resource.tf b/examples/resources/sonarqube_group/resource.tf new file mode 100644 index 00000000..7a89843e --- /dev/null +++ b/examples/resources/sonarqube_group/resource.tf @@ -0,0 +1,4 @@ +resource "sonarqube_group" "project_users" { + name = "Project-Users" + description = "This is a group" +} diff --git a/examples/resources/sonarqube_group_member/resource.tf b/examples/resources/sonarqube_group_member/resource.tf new file mode 100644 index 00000000..9e698848 --- /dev/null +++ b/examples/resources/sonarqube_group_member/resource.tf @@ -0,0 +1,15 @@ +resource "sonarqube_user" "user" { + login_name = "terraform-test" + name = "terraform-test" + password = "secret-sauce37!" +} + +resource "sonarqube_group" "project_users" { + name = "Project-Users" + description = "This is a group" +} + +resource "sonarqube_group_member" "project_users_member" { + name = sonarqube_group.project_users.name + login_name = sonarqube_user.user.login_name +} diff --git a/examples/resources/sonarqube_new_code_periods/global.tf b/examples/resources/sonarqube_new_code_periods/global.tf new file mode 100644 index 00000000..2365b7e5 --- /dev/null +++ b/examples/resources/sonarqube_new_code_periods/global.tf @@ -0,0 +1,4 @@ +resource "sonarqube_new_code_periods" "code_period" { + type = "NUMBER_OF_DAYS" + value = "7" +} diff --git a/examples/resources/sonarqube_new_code_periods/project.tf b/examples/resources/sonarqube_new_code_periods/project.tf new file mode 100644 index 00000000..0f5344bf --- /dev/null +++ b/examples/resources/sonarqube_new_code_periods/project.tf @@ -0,0 +1,8 @@ +resource "sonarqube_project" "reference" { + name = "my-project" +} + +resource "sonarqube_new_code_periods" "reference" { + project = sonarqube_project.reference.project + type = "REFERENCE_BRANCH" + value = "main" diff --git a/examples/resources/sonarqube_permission_template/resource.tf b/examples/resources/sonarqube_permission_template/resource.tf new file mode 100644 index 00000000..983b9bf1 --- /dev/null +++ b/examples/resources/sonarqube_permission_template/resource.tf @@ -0,0 +1,5 @@ +resource "sonarqube_permission_template" "template" { + name = "Internal-Projects" + description = "These are internal projects" + project_key_pattern = "internal.*" +} diff --git a/examples/resources/sonarqube_permissions/global-admin.tf b/examples/resources/sonarqube_permissions/global-admin.tf new file mode 100644 index 00000000..0e63df2d --- /dev/null +++ b/examples/resources/sonarqube_permissions/global-admin.tf @@ -0,0 +1,4 @@ +resource "sonarqube_permissions" "my_global_admins" { + group_name = "my-admins" + permissions = ["admin"] +} diff --git a/examples/resources/sonarqube_permissions/project-admin.tf b/examples/resources/sonarqube_permissions/project-admin.tf new file mode 100644 index 00000000..24a16cc4 --- /dev/null +++ b/examples/resources/sonarqube_permissions/project-admin.tf @@ -0,0 +1,5 @@ +resource "sonarqube_permissions" "my_project_admins" { + group_name = "my-project-admins" + project_key = "my-project" + permissions = ["admin"] +} diff --git a/examples/resources/sonarqube_permissions/project-template.tf b/examples/resources/sonarqube_permissions/project-template.tf new file mode 100644 index 00000000..8896bd8f --- /dev/null +++ b/examples/resources/sonarqube_permissions/project-template.tf @@ -0,0 +1,5 @@ +resource "sonarqube_permissions" "internal_admins" { + group_name = "my-internal-admins" + template_id = sonarqube_permission_template.template.id + permissions = ["admin"] +} diff --git a/examples/resources/sonarqube_permissions/project-user.tf b/examples/resources/sonarqube_permissions/project-user.tf new file mode 100644 index 00000000..058c8a4d --- /dev/null +++ b/examples/resources/sonarqube_permissions/project-user.tf @@ -0,0 +1,5 @@ +resource "sonarqube_permissions" "john_project_read" { + login_name = "johndoe" + project_key = "my-project" + permissions = ["codeviewer", "user"] +} diff --git a/examples/resources/sonarqube_plugin/resource.tf b/examples/resources/sonarqube_plugin/resource.tf new file mode 100644 index 00000000..088a09fe --- /dev/null +++ b/examples/resources/sonarqube_plugin/resource.tf @@ -0,0 +1,3 @@ +resource "sonarqube_plugin" "main" { + key = "cloudformation" +} diff --git a/examples/resources/sonarqube_portfolio/resource.tf b/examples/resources/sonarqube_portfolio/resource.tf new file mode 100644 index 00000000..16f96951 --- /dev/null +++ b/examples/resources/sonarqube_portfolio/resource.tf @@ -0,0 +1,5 @@ +resource "sonarqube_portfolio" "main" { + key = "portfolio-key" + name = "portfolio-name" + description = "portfolio-description" +} diff --git a/examples/resources/sonarqube_project/project-settings.tf b/examples/resources/sonarqube_project/project-settings.tf new file mode 100644 index 00000000..2cc41c0c --- /dev/null +++ b/examples/resources/sonarqube_project/project-settings.tf @@ -0,0 +1,10 @@ +resource "sonarqube_project" "main" { + name = "SonarQube" + project = "my_project" + visibility = "public" + + setting { + key = "sonar.demo" + value = "sonarqube@example.org" + } +} diff --git a/examples/resources/sonarqube_project/project.tf b/examples/resources/sonarqube_project/project.tf new file mode 100644 index 00000000..6a6f2e22 --- /dev/null +++ b/examples/resources/sonarqube_project/project.tf @@ -0,0 +1,5 @@ +resource "sonarqube_project" "main" { + name = "SonarQube" + project = "my_project" + visibility = "public" +} diff --git a/examples/resources/sonarqube_project_main_branch/resource.tf b/examples/resources/sonarqube_project_main_branch/resource.tf new file mode 100644 index 00000000..b56216c6 --- /dev/null +++ b/examples/resources/sonarqube_project_main_branch/resource.tf @@ -0,0 +1,9 @@ +resource "sonarqube_project" "main" { + name = "SonarQube" + project = "my_project" + visibility = "public" +} +resource "sonarqube_project_main_branch" "mybranch" { + name = "release" + project = "my_project" +} diff --git a/examples/resources/sonarqube_qualitygate/resource.tf b/examples/resources/sonarqube_qualitygate/resource.tf new file mode 100644 index 00000000..f725fd3c --- /dev/null +++ b/examples/resources/sonarqube_qualitygate/resource.tf @@ -0,0 +1,16 @@ +resource "sonarqube_qualitygate" "main" { + name = "example" + is_default = true + + condition { + metric = "new_coverage" + op = "LT" + threshold = "50" + } + + condition { + metric = "vulnerabilities" + threshold = "10" + op = "GT" + } +} diff --git a/examples/resources/sonarqube_qualitygate_project_association/resource.tf b/examples/resources/sonarqube_qualitygate_project_association/resource.tf new file mode 100644 index 00000000..92b6cff3 --- /dev/null +++ b/examples/resources/sonarqube_qualitygate_project_association/resource.tf @@ -0,0 +1,22 @@ +## Example: create a quality gate project association + +resource "sonarqube_qualitygate" "main" { + name = "my_qualitygate" + + condition { + metric = "new_coverage" + op = "LT" + threshold = "30" + } +} + +resource "sonarqube_project" "main" { + name = "SonarQube" + project = "my_project" + visibility = "public" +} + +resource "sonarqube_qualitygate_project_association" "main" { + gatename = sonarqube_qualitygate.main.id + projectkey = sonarqube_project.main.project +} diff --git a/examples/resources/sonarqube_qualitygate_usergroup_association/user-association.tf b/examples/resources/sonarqube_qualitygate_usergroup_association/user-association.tf new file mode 100644 index 00000000..ee7a6a59 --- /dev/null +++ b/examples/resources/sonarqube_qualitygate_usergroup_association/user-association.tf @@ -0,0 +1,20 @@ +resource "sonarqube_qualitygate" "main" { + name = "my_qualitygate" + + condition { + metric = "new_coverage" + op = "LT" + threshold = "30" + } +} + +resource "sonarqube_user" "qa_user" { + login_name = "qa-user" + name = "qa-user" + password = "secret-sauce37!" +} + +resource "sonarqube_qualitygate_usergroup_association" "main" { + gatename = sonarqube_qualitygate.main.id + login_name = sonarqube_user.qa_user.id +} diff --git a/examples/resources/sonarqube_qualitygate_usergroup_association/usergroup-association.tf b/examples/resources/sonarqube_qualitygate_usergroup_association/usergroup-association.tf new file mode 100644 index 00000000..5c2889fd --- /dev/null +++ b/examples/resources/sonarqube_qualitygate_usergroup_association/usergroup-association.tf @@ -0,0 +1,19 @@ +resource "sonarqube_qualitygate" "main" { + name = "my_qualitygate" + + condition { + metric = "new_coverage" + op = "LT" + threshold = "30" + } +} + +resource "sonarqube_group" "qa_team" { + name = "QA-Team" + description = "Quality Assurence Team" +} + +resource "sonarqube_qualitygate_usergroup_association" "main" { + gatename = sonarqube_qualitygate.main.id + group_name = sonarqube_group.qa_team.name +} diff --git a/examples/resources/sonarqube_qualityprofile/resource.tf b/examples/resources/sonarqube_qualityprofile/resource.tf new file mode 100644 index 00000000..42982c7d --- /dev/null +++ b/examples/resources/sonarqube_qualityprofile/resource.tf @@ -0,0 +1,6 @@ +resource "sonarqube_qualityprofile" "main" { + name = "example" + language = "js" + is_default = false + parent = "sonar way" +} diff --git a/examples/resources/sonarqube_qualityprofile_activate_rule/resource.tf b/examples/resources/sonarqube_qualityprofile_activate_rule/resource.tf new file mode 100644 index 00000000..f36261c7 --- /dev/null +++ b/examples/resources/sonarqube_qualityprofile_activate_rule/resource.tf @@ -0,0 +1,23 @@ +resource "sonarqube_rule" "allowed_maven_dependencies" { + custom_key = "Only_use_allowed_Maven_dependencies" + markdown_description = "Description" + name = "Only use allowed Maven dependencies" + params = "FilePattern=**/pom.xml" + severity = "BLOCKER" + status = "READY" + template_key = "xml:XPathCheck" + type = "VULNERABILITY" +} + +resource "sonarqube_qualityprofile" "xml" { + name = "test way - xml" + language = "xml" + is_default = "false" + parent = "Sonar way" +} + +resource "sonarqube_qualityprofile_activate_rule" "xml_rule" { + key = sonarqube_qualityprofile.xml.key # .id also works + rule = sonarqube_rule.allowed_maven_dependencies.id + severity = "BLOCKER" +} diff --git a/examples/resources/sonarqube_qualityprofile_project_association/resource.tf b/examples/resources/sonarqube_qualityprofile_project_association/resource.tf new file mode 100644 index 00000000..39b77d8d --- /dev/null +++ b/examples/resources/sonarqube_qualityprofile_project_association/resource.tf @@ -0,0 +1,16 @@ +resource "sonarqube_qualityprofile" "main" { + name = "my_quality_profile" + language = "js" +} + +resource "sonarqube_project" "main" { + name = "SonarQube" + project = "my_project" + visibility = "public" +} + +resource "sonarqube_qualityprofile_project_association" "main" { + quality_profile = sonarqube_qualityprofile.main.name + project = sonarqube_project.main.project + language = "js" +} diff --git a/examples/resources/sonarqube_rules/resource.tf b/examples/resources/sonarqube_rules/resource.tf new file mode 100644 index 00000000..2a85fa2d --- /dev/null +++ b/examples/resources/sonarqube_rules/resource.tf @@ -0,0 +1,11 @@ +resource "sonarqube_rule" "rule" { + key = "rule_test" + markdown_description = "Description of my rule" + name = "rule test" + params = "FilePattern=**/pom.xml" + prevent_reactivation = "false" + severity = "CRITICAL" + status = "READY" + template_key = "xml:XPathCheck" + type = "VULNERABILITY" +} diff --git a/examples/resources/sonarqube_setting/multi-field-values.tf b/examples/resources/sonarqube_setting/multi-field-values.tf new file mode 100644 index 00000000..e97740fb --- /dev/null +++ b/examples/resources/sonarqube_setting/multi-field-values.tf @@ -0,0 +1,13 @@ +resource "sonarqube_setting" "multi_field_setting" { + key = "sonar.issue.ignore.multicriteria" + field_values = [ + { + "ruleKey" : "foo", + "resourceKey" : "bar" + }, + { + "ruleKey" : "foo2", + "resourceKey" : "bar2" + } + ] +} diff --git a/examples/resources/sonarqube_setting/multi-value.tf b/examples/resources/sonarqube_setting/multi-value.tf new file mode 100644 index 00000000..cf1aa4e6 --- /dev/null +++ b/examples/resources/sonarqube_setting/multi-value.tf @@ -0,0 +1,4 @@ +resource "sonarqube_setting" "multi_value_setting" { + key = "sonar.global.exclusions" + values = ["foo", "bar/**/*.*"] +} diff --git a/examples/resources/sonarqube_user/local.tf b/examples/resources/sonarqube_user/local.tf new file mode 100644 index 00000000..8a73775c --- /dev/null +++ b/examples/resources/sonarqube_user/local.tf @@ -0,0 +1,5 @@ +resource "sonarqube_user" "user" { + login_name = "terraform-test" + name = "terraform-test" + password = "secret-sauce37!" +} diff --git a/examples/resources/sonarqube_user/remote.tf b/examples/resources/sonarqube_user/remote.tf new file mode 100644 index 00000000..4b59a43e --- /dev/null +++ b/examples/resources/sonarqube_user/remote.tf @@ -0,0 +1,6 @@ +resource "sonarqube_user" "remote_user" { + login_name = "terraform-test" + name = "terraform-test" + email = "terraform-test@sonarqube.com" + is_local = false +} diff --git a/examples/resources/sonarqube_user_external_identity/resource.tf b/examples/resources/sonarqube_user_external_identity/resource.tf new file mode 100644 index 00000000..eb7175b1 --- /dev/null +++ b/examples/resources/sonarqube_user_external_identity/resource.tf @@ -0,0 +1,14 @@ +## Example: change the external identity to SAML + +resource "sonarqube_user" "remote_user" { + login_name = "terraform-test" + name = "terraform-test" + email = "terraform-test@sonarqube.com" + is_local = false +} + +resource "sonarqube_user_external_identity" "remote_user" { + login_name = sonarqube_user.remote_user.login_name + external_identity = "terraform-test@sonarqube.com" + external_provider = "saml" +} diff --git a/examples/resources/sonarqube_user_token/global-analysis-token.tf b/examples/resources/sonarqube_user_token/global-analysis-token.tf new file mode 100644 index 00000000..b6c32ff9 --- /dev/null +++ b/examples/resources/sonarqube_user_token/global-analysis-token.tf @@ -0,0 +1,9 @@ +resource "sonarqube_user_token" "token" { + name = "my-token" + type = "GLOBAL_ANALYSIS_TOKEN" + expiration_date = "2099-01-01" +} + +output "global_analysis_token" { + value = sonarqube_user_token.token.token +} diff --git a/examples/resources/sonarqube_user_token/project-analysis-token.tf b/examples/resources/sonarqube_user_token/project-analysis-token.tf new file mode 100644 index 00000000..2bd59aee --- /dev/null +++ b/examples/resources/sonarqube_user_token/project-analysis-token.tf @@ -0,0 +1,9 @@ +resource "sonarqube_user_token" "token" { + name = "my-token" + type = "PROJECT_ANALYSIS_TOKEN" + project_key = "my-project" +} + +output "project_analysis_token" { + value = sonarqube_user_token.token.token +} diff --git a/examples/resources/sonarqube_user_token/user-token.tf b/examples/resources/sonarqube_user_token/user-token.tf new file mode 100644 index 00000000..5afdfd45 --- /dev/null +++ b/examples/resources/sonarqube_user_token/user-token.tf @@ -0,0 +1,14 @@ +resource "sonarqube_user" "user" { + login_name = "terraform-test" + name = "terraform-test" + password = "secret-sauce37!" +} + +resource "sonarqube_user_token" "token" { + login_name = sonarqube_user.user.login_name + name = "my-token" +} + +output "user_token" { + value = sonarqube_user_token.token.token +} diff --git a/examples/resources/sonarqube_webhook/project-webhook.tf b/examples/resources/sonarqube_webhook/project-webhook.tf new file mode 100644 index 00000000..ce184124 --- /dev/null +++ b/examples/resources/sonarqube_webhook/project-webhook.tf @@ -0,0 +1,11 @@ +resource "sonarqube_project" "project" { + name = "project" + project = "project" + visibility = "public" +} + +resource "sonarqube_webhook" "webhook" { + name = "terraform-webhook" + url = "https://my-webhook-destination.example.com" + project = sonarqube_project.project.name +} diff --git a/examples/resources/sonarqube_webhook/webhook.tf b/examples/resources/sonarqube_webhook/webhook.tf new file mode 100644 index 00000000..77840c3b --- /dev/null +++ b/examples/resources/sonarqube_webhook/webhook.tf @@ -0,0 +1,4 @@ +resource "sonarqube_webhook" "webhook" { + name = "terraform-webhook" + url = "https://my-webhook-destination.example.com" +} diff --git a/sonarqube/data_source_sonarqube_group.go b/sonarqube/data_source_sonarqube_group.go index 441cbb46..787aa2dc 100644 --- a/sonarqube/data_source_sonarqube_group.go +++ b/sonarqube/data_source_sonarqube_group.go @@ -6,15 +6,18 @@ import ( func dataSourceSonarqubeGroup() *schema.Resource { return &schema.Resource{ - Read: dataSourceSonarqubeGroupRead, + Description: "Use this data source to get a Sonarqube Group resource", + Read: dataSourceSonarqubeGroupRead, Schema: map[string]*schema.Schema{ "name": { - Type: schema.TypeString, - Required: true, + Type: schema.TypeString, + Required: true, + Description: "The name of the group.", }, "description": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Computed: true, + Description: "The group description.", }, }, } diff --git a/sonarqube/data_source_sonarqube_portfolio.go b/sonarqube/data_source_sonarqube_portfolio.go index 4edbb386..d5202877 100644 --- a/sonarqube/data_source_sonarqube_portfolio.go +++ b/sonarqube/data_source_sonarqube_portfolio.go @@ -6,35 +6,43 @@ import ( func dataSourceSonarqubePortfolio() *schema.Resource { return &schema.Resource{ - Read: dataSourceSonarqubePortfolioRead, + Description: "Use this data source to get a Sonarqube portfolio resource", + Read: dataSourceSonarqubePortfolioRead, Schema: map[string]*schema.Schema{ "key": { - Type: schema.TypeString, - Required: true, + Type: schema.TypeString, + Required: true, + Description: "The key of the portfolio", }, "name": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Computed: true, + Description: "Name of the portfolio", }, "description": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Computed: true, + Description: "Description of the portfolio", }, "qualifier": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Computed: true, + Description: "`VW` (portfolios always have this qualifier)", }, "visibility": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Computed: true, + Description: "Portfolio visibility", }, "selection_mode": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Computed: true, + Description: "How the Portfolio is populated. Possible values are `NONE`, `MANUAL`, `TAGS`, `REGEXP` or `REST`. [See docs](https://docs.sonarqube.org/9.8/project-administration/managing-portfolios/#populating-portfolios) for how Portfolio population works", }, "branch": { // Only active for TAGS, REGEXP and REST - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Computed: true, + Description: "Which branch is analyzed", }, "tags": { // Only active for TAGS Type: schema.TypeList, @@ -42,10 +50,12 @@ func dataSourceSonarqubePortfolio() *schema.Resource { Elem: &schema.Schema{ Type: schema.TypeString, }, + Description: "The list of tags used to populate the Portfolio. Only active when `selection_mode` is `TAGS`", }, "regexp": { // Only active for REGEXP - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Computed: true, + Description: "The regular expression used to populate the portfolio. Only active when `selection_mode` is `REGEXP`", }, }, } diff --git a/sonarqube/data_source_sonarqube_project.go b/sonarqube/data_source_sonarqube_project.go index 58e6e074..c994afed 100644 --- a/sonarqube/data_source_sonarqube_project.go +++ b/sonarqube/data_source_sonarqube_project.go @@ -6,19 +6,23 @@ import ( func dataSourceSonarqubeProject() *schema.Resource { return &schema.Resource{ - Read: dataSourceSonarqubeProjectRead, + Description: "Use this data source to get a Sonarqube project resource", + Read: dataSourceSonarqubeProjectRead, Schema: map[string]*schema.Schema{ "name": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Computed: true, + Description: "Name of the project", }, "project": { - Type: schema.TypeString, - Required: true, + Type: schema.TypeString, + Required: true, + Description: "The project key of the project", }, "visibility": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Computed: true, + Description: "Project visibility", }, }, } diff --git a/sonarqube/data_source_sonarqube_qualitygate.go b/sonarqube/data_source_sonarqube_qualitygate.go index 0fa5d836..352f83fa 100644 --- a/sonarqube/data_source_sonarqube_qualitygate.go +++ b/sonarqube/data_source_sonarqube_qualitygate.go @@ -6,19 +6,23 @@ import ( func dataSourceSonarqubeQualityGate() *schema.Resource { return &schema.Resource{ - Read: dataSourceSonarqubeQualityGateRead, + Description: "Use this data source to get a Sonarqube qualitygate resource", + Read: dataSourceSonarqubeQualityGateRead, Schema: map[string]*schema.Schema{ "name": { - Type: schema.TypeString, - Required: true, + Type: schema.TypeString, + Required: true, + Description: "The name of the Quality Gate.", }, "copy_from": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Computed: true, + Description: "Origin of the Quality Gate", }, "is_default": { - Type: schema.TypeBool, - Computed: true, + Type: schema.TypeBool, + Computed: true, + Description: "Quality Gate default.", }, "condition": { Type: schema.TypeList, @@ -43,6 +47,7 @@ func dataSourceSonarqubeQualityGate() *schema.Resource { }, }, }, + Description: "List of Quality Gate conditions.", }, }, } diff --git a/sonarqube/data_source_sonarqube_qualityprofile.go b/sonarqube/data_source_sonarqube_qualityprofile.go index 300727f7..75b01218 100644 --- a/sonarqube/data_source_sonarqube_qualityprofile.go +++ b/sonarqube/data_source_sonarqube_qualityprofile.go @@ -6,23 +6,28 @@ import ( func dataSourceSonarqubeQualityProfile() *schema.Resource { return &schema.Resource{ - Read: dataSourceSonarqubeQualityProfileRead, + Description: "Use this data source to get a Sonarqube qualityprofile resource", + Read: dataSourceSonarqubeQualityProfileRead, Schema: map[string]*schema.Schema{ "name": { - Type: schema.TypeString, - Required: true, + Type: schema.TypeString, + Required: true, + Description: "The name of the Quality Profile", }, "key": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Computed: true, + Description: "The key of the Quality Profile", }, "language": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Computed: true, + Description: "Quality Profile language", }, "is_default": { - Type: schema.TypeBool, - Computed: true, + Type: schema.TypeBool, + Computed: true, + Description: "Quality Profile default", }, }, } diff --git a/sonarqube/data_source_sonarqube_rule.go b/sonarqube/data_source_sonarqube_rule.go index ae9901b9..469e6ba5 100644 --- a/sonarqube/data_source_sonarqube_rule.go +++ b/sonarqube/data_source_sonarqube_rule.go @@ -6,35 +6,43 @@ import ( func dataSourceSonarqubeRule() *schema.Resource { return &schema.Resource{ - Read: dataSourceSonarqubeRuleRead, + Description: "Use this data source to get a Sonarqube rule resource", + Read: dataSourceSonarqubeRuleRead, Schema: map[string]*schema.Schema{ "key": { - Type: schema.TypeString, - Required: true, + Type: schema.TypeString, + Required: true, + Description: "The key of the sonarqube rule. Should be :. https://next.sonarqube.com/sonarqube/web_api/api/rules?query=api%2Frules%2Fcreate", }, "markdown_description": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Computed: true, + Description: "Rule description", }, "name": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Computed: true, + Description: "Rule name", }, "severity": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Computed: true, + Description: "Rule severity", }, "status": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Computed: true, + Description: "Rule status", }, "template_key": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Computed: true, + Description: "Key of the template rule", }, "type": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Computed: true, + Description: "Rule type", }, }, } diff --git a/sonarqube/data_source_sonarqube_user.go b/sonarqube/data_source_sonarqube_user.go index 9a298f2f..b43d4233 100644 --- a/sonarqube/data_source_sonarqube_user.go +++ b/sonarqube/data_source_sonarqube_user.go @@ -6,23 +6,28 @@ import ( func dataSourceSonarqubeUser() *schema.Resource { return &schema.Resource{ - Read: dataSourceSonarqubeUserRead, + Description: "Use this data source to get a Sonarqube User resource", + Read: dataSourceSonarqubeUserRead, Schema: map[string]*schema.Schema{ "login_name": { - Type: schema.TypeString, - Required: true, + Type: schema.TypeString, + Required: true, + Description: "The login name of the user", }, "name": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Computed: true, + Description: "The name of the user", }, "email": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Computed: true, + Description: "The email of the user", }, "is_local": { - Type: schema.TypeBool, - Computed: true, + Type: schema.TypeBool, + Computed: true, + Description: "Whether the user is local", }, }, } diff --git a/sonarqube/resource_sonarqube_alm_azure.go b/sonarqube/resource_sonarqube_alm_azure.go index 9f65d259..c6df2d51 100644 --- a/sonarqube/resource_sonarqube_alm_azure.go +++ b/sonarqube/resource_sonarqube_alm_azure.go @@ -22,6 +22,8 @@ type GetAlmAzure struct { // Returns the resource represented by this file. func resourceSonarqubeAlmAzure() *schema.Resource { return &schema.Resource{ + Description: `Provides a Sonarqube Azure Devops Alm/Devops Platform Integration resource. This can be used to create and manage a Alm/Devops +Platform Integration for Azure Devops.`, Create: resourceSonarqubeAlmAzureCreate, Read: resourceSonarqubeAlmAzureRead, Update: resourceSonarqubeAlmAzureUpdate, @@ -114,8 +116,8 @@ func resourceSonarqubeAlmAzureRead(d *schema.ResourceData, m interface{}) error } } return fmt.Errorf("resourceSonarqubeAzureBindingRead: Failed to find azure binding: %+v", d.Id()) - } + func resourceSonarqubeAlmAzureUpdate(d *schema.ResourceData, m interface{}) error { sonarQubeURL := m.(*ProviderConfiguration).sonarQubeURL sonarQubeURL.Path = strings.TrimSuffix(sonarQubeURL.Path, "/") + "/api/alm_settings/update_azure" diff --git a/sonarqube/resource_sonarqube_alm_github.go b/sonarqube/resource_sonarqube_alm_github.go index 817fe5a0..3f668d2b 100644 --- a/sonarqube/resource_sonarqube_alm_github.go +++ b/sonarqube/resource_sonarqube_alm_github.go @@ -23,6 +23,8 @@ type GetAlmGithub struct { // Returns the resource represented by this file. func resourceSonarqubeAlmGithub() *schema.Resource { return &schema.Resource{ + Description: `Provides a Sonarqube GitHub Alm/Devops Platform Integration resource. This can be used to create and manage a Alm/Devops +Platform Integration for GitHub.`, Create: resourceSonarqubeAlmGithubCreate, Read: resourceSonarqubeAlmGithubRead, Update: resourceSonarqubeAlmGithubUpdate, @@ -31,39 +33,46 @@ func resourceSonarqubeAlmGithub() *schema.Resource { // Define the fields of this schema. Schema: map[string]*schema.Schema{ "app_id": { - Type: schema.TypeString, - Required: true, - ForceNew: true, + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "GitHub App ID. Maximum length: 80", }, "client_id": { - Type: schema.TypeString, - Required: true, - ForceNew: true, + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "GitHub App Client ID. Maximum length: 80", }, "client_secret": { - Type: schema.TypeString, - Required: true, - ForceNew: true, + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "GitHub App Client Secret. Maximum length: 160", }, "key": { - Type: schema.TypeString, - Required: true, - ForceNew: true, + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "Unique key of the GitHUb instance setting. Maximum length: 200", }, "private_key": { - Type: schema.TypeString, - Required: true, - ForceNew: true, + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "GitHub App private key. Maximum length: 2500", }, "url": { - Type: schema.TypeString, - Required: true, - ForceNew: true, + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "GitHub API URL. Maximum length: 2000", }, "webhook_secret": { - Type: schema.TypeString, - Optional: true, - ForceNew: false, + Type: schema.TypeString, + Optional: true, + ForceNew: false, + Description: "GitHub App Webhook Secret. Maximum length: 160", }, }, } @@ -134,8 +143,8 @@ func resourceSonarqubeAlmGithubRead(d *schema.ResourceData, m interface{}) error } } return fmt.Errorf("resourceSonarqubeGithubBindingRead: Failed to find github binding: %+v", d.Id()) - } + func resourceSonarqubeAlmGithubUpdate(d *schema.ResourceData, m interface{}) error { sonarQubeURL := m.(*ProviderConfiguration).sonarQubeURL sonarQubeURL.Path = strings.TrimSuffix(sonarQubeURL.Path, "/") + "/api/alm_settings/update_github" diff --git a/sonarqube/resource_sonarqube_alm_gitlab.go b/sonarqube/resource_sonarqube_alm_gitlab.go index a86dab4d..8fd587ce 100644 --- a/sonarqube/resource_sonarqube_alm_gitlab.go +++ b/sonarqube/resource_sonarqube_alm_gitlab.go @@ -23,6 +23,8 @@ type GetAlmGitlab struct { // Returns the resource represented by this file. func resourceSonarqubeAlmGitlab() *schema.Resource { return &schema.Resource{ + Description: `Provides a Sonarqube GitLab Alm/Devops Platform Integration resource. This can be used to create and manage a Alm/Devops +Platform Integration for GitLab.`, Create: resourceSonarqubeAlmGitlabCreate, Read: resourceSonarqubeAlmGitlabRead, Update: resourceSonarqubeAlmGitlabUpdate, @@ -35,17 +37,20 @@ func resourceSonarqubeAlmGitlab() *schema.Resource { Required: true, ForceNew: true, ValidateDiagFunc: validation.ToDiagFunc(validation.StringLenBetween(1, 200)), + Description: "Unique key of the GitLab instance setting. Maximum length: 200", }, "personal_access_token": { Type: schema.TypeString, Required: true, Sensitive: true, ValidateDiagFunc: validation.ToDiagFunc(validation.StringLenBetween(1, 2000)), + Description: "GitLab App personal access token with the `read_api` scope. See [this doc](https://docs.sonarqube.org/latest/devops-platform-integration/gitlab-integration/#importing-your-gitlab-projects-into-sonarqube) for more information. Maximum length: 2000", }, "url": { Type: schema.TypeString, Required: true, ValidateDiagFunc: validation.ToDiagFunc(validation.StringLenBetween(1, 2000)), + Description: "GitLab API URL. Maximum length: 2000", }, }, } @@ -111,8 +116,8 @@ func resourceSonarqubeAlmGitlabRead(d *schema.ResourceData, m interface{}) error } } return fmt.Errorf("resourceSonarqubeGitlabBindingRead: Failed to find gitlab binding: %+v", d.Id()) - } + func resourceSonarqubeAlmGitlabUpdate(d *schema.ResourceData, m interface{}) error { sonarQubeURL := m.(*ProviderConfiguration).sonarQubeURL sonarQubeURL.Path = strings.TrimSuffix(sonarQubeURL.Path, "/") + "/api/alm_settings/update_gitlab" diff --git a/sonarqube/resource_sonarqube_azure_binding.go b/sonarqube/resource_sonarqube_azure_binding.go index c29a723e..6b8d006d 100644 --- a/sonarqube/resource_sonarqube_azure_binding.go +++ b/sonarqube/resource_sonarqube_azure_binding.go @@ -24,6 +24,8 @@ type GetAzureBinding struct { // Returns the resource represented by this file. func resourceSonarqubeAzureBinding() *schema.Resource { return &schema.Resource{ + Description: `Provides a Sonarqube Azure Devops binding resource. This can be used to create and manage the binding between an +Azure Devops repository and a SonarQube project`, Create: resourceSonarqubeAzureBindingCreate, Read: resourceSonarqubeAzureBindingRead, Delete: resourceSonarqubeAzureBindingDelete, diff --git a/sonarqube/resource_sonarqube_github_binding.go b/sonarqube/resource_sonarqube_github_binding.go index ab4c9692..36fe8aa6 100644 --- a/sonarqube/resource_sonarqube_github_binding.go +++ b/sonarqube/resource_sonarqube_github_binding.go @@ -24,6 +24,8 @@ type GetBinding struct { // Returns the resource represented by this file. func resourceSonarqubeGithubBinding() *schema.Resource { return &schema.Resource{ + Description: `Provides a Sonarqube GitHub binding resource. This can be used to create and manage the binding between a +GitHub repository and a SonarQube project`, Create: resourceSonarqubeGithubBindingCreate, Read: resourceSonarqubeGithubBindingRead, Delete: resourceSonarqubeGithubBindingDelete, @@ -33,31 +35,36 @@ func resourceSonarqubeGithubBinding() *schema.Resource { // Define the fields of this schema. Schema: map[string]*schema.Schema{ "alm_setting": { - Type: schema.TypeString, - Required: true, - ForceNew: true, + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "GitHub ALM setting key", }, "monorepo": { - Type: schema.TypeString, - Optional: true, - Default: "false", - ForceNew: true, + Type: schema.TypeString, + Optional: true, + Default: "false", + ForceNew: true, + Description: "Is this project part of a monorepo. Default value: false", }, "project": { - Type: schema.TypeString, - Required: true, - ForceNew: true, + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "Project key", }, "repository": { - Type: schema.TypeString, - Required: true, - ForceNew: true, + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "The full name of your GitHub repository, including the organization, case-sensitive. Maximum length: 256", }, "summary_comment_enabled": { - Type: schema.TypeString, - Optional: true, - Default: "true", - ForceNew: true, + Type: schema.TypeString, + Optional: true, + Default: "true", + ForceNew: true, + Description: "Enable/disable summary in PR discussion tab. Default value: true", }, }, } diff --git a/sonarqube/resource_sonarqube_gitlab_binding.go b/sonarqube/resource_sonarqube_gitlab_binding.go index 94edf92a..ead6bc61 100644 --- a/sonarqube/resource_sonarqube_gitlab_binding.go +++ b/sonarqube/resource_sonarqube_gitlab_binding.go @@ -14,6 +14,8 @@ import ( // Returns the resource represented by this file. func resourceSonarqubeGitlabBinding() *schema.Resource { return &schema.Resource{ + Description: `Provides a Sonarqube GitLab binding resource. This can be used to create and manage the binding between a +GitLab repository and a SonarQube project`, Create: resourceSonarqubeGitlabBindingCreate, // You can update any project binding with the same API call as the CREATE Update: resourceSonarqubeGitlabBindingCreate, @@ -25,22 +27,26 @@ func resourceSonarqubeGitlabBinding() *schema.Resource { // Define the fields of this schema. Schema: map[string]*schema.Schema{ "alm_setting": { - Type: schema.TypeString, - Required: true, + Type: schema.TypeString, + Required: true, + Description: "GitLab ALM setting key", }, "monorepo": { - Type: schema.TypeString, - Optional: true, - Default: "false", + Type: schema.TypeString, + Optional: true, + Default: "false", + Description: "Is this project part of a monorepo. Default value: false", }, "project": { - Type: schema.TypeString, - Required: true, - ForceNew: true, + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "SonarQube project key. Changing this will force a new resource to be created", }, "repository": { - Type: schema.TypeString, - Required: true, + Type: schema.TypeString, + Required: true, + Description: "The GitLab project ID", }, }, } diff --git a/sonarqube/resource_sonarqube_group.go b/sonarqube/resource_sonarqube_group.go index ad51fba7..a096db20 100644 --- a/sonarqube/resource_sonarqube_group.go +++ b/sonarqube/resource_sonarqube_group.go @@ -35,10 +35,11 @@ type Group struct { // Returns the resource represented by this file. func resourceSonarqubeGroup() *schema.Resource { return &schema.Resource{ - Create: resourceSonarqubeGroupCreate, - Read: resourceSonarqubeGroupRead, - Update: resourceSonarqubeGroupUpdate, - Delete: resourceSonarqubeGroupDelete, + Description: "Provides a Sonarqube Group resource. This can be used to create and manage Sonarqube Groups.", + Create: resourceSonarqubeGroupCreate, + Read: resourceSonarqubeGroupRead, + Update: resourceSonarqubeGroupUpdate, + Delete: resourceSonarqubeGroupDelete, Importer: &schema.ResourceImporter{ State: resourceSonarqubeGroupImport, }, @@ -46,12 +47,14 @@ func resourceSonarqubeGroup() *schema.Resource { // Define the fields of this schema. Schema: map[string]*schema.Schema{ "name": { - Type: schema.TypeString, - Required: true, + Type: schema.TypeString, + Required: true, + Description: "The name of the Group to create. Changing this forces a new resource to be created.", }, "description": { - Type: schema.TypeString, - Optional: true, + Type: schema.TypeString, + Optional: true, + Description: "Description of the Group.", }, }, } diff --git a/sonarqube/resource_sonarqube_group_member.go b/sonarqube/resource_sonarqube_group_member.go index e0f76f7c..6d5ece2d 100644 --- a/sonarqube/resource_sonarqube_group_member.go +++ b/sonarqube/resource_sonarqube_group_member.go @@ -26,9 +26,10 @@ type GetGroupMembersResponse struct { // Returns the resource represented by this file. func resourceSonarqubeGroupMember() *schema.Resource { return &schema.Resource{ - Create: resourceSonarqubeGroupMemberCreate, - Read: resourceSonarqubeGroupMemberRead, - Delete: resourceSonarqubeGroupMemberDelete, + Description: "Provides a Sonarqube Group Member resource. This can be used to add or remove user to or from Sonarqube Groups.", + Create: resourceSonarqubeGroupMemberCreate, + Read: resourceSonarqubeGroupMemberRead, + Delete: resourceSonarqubeGroupMemberDelete, Importer: &schema.ResourceImporter{ State: resourceSonarqubeGroupMemberImport, }, @@ -36,14 +37,16 @@ func resourceSonarqubeGroupMember() *schema.Resource { // Define the fields of this schema. Schema: map[string]*schema.Schema{ "name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "The name of the Group to add a member to. Changing this forces a new resource to be created.", }, "login_name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "The `login_name` of the User to add as a member. Changing this forces a new resource to be created.", }, }, } diff --git a/sonarqube/resource_sonarqube_new_code_periods.go b/sonarqube/resource_sonarqube_new_code_periods.go index 25e1862c..f9c0e918 100644 --- a/sonarqube/resource_sonarqube_new_code_periods.go +++ b/sonarqube/resource_sonarqube_new_code_periods.go @@ -35,10 +35,11 @@ const ( // Returns the resource represented by this file. func resourceSonarqubeNewCodePeriodsBinding() *schema.Resource { return &schema.Resource{ - Create: resourceSonarqubeNewCodePeriodsCreate, - Read: resourceSonarqubeNewCodePeriodsRead, - Update: resourceSonarqubeNewCodePeriodsCreate, - Delete: resourceSonarqubeNewCodePeriodsDelete, + Description: "Provides a Sonarqube New Code Periods resource. This can be used to manage Sonarqube New Code Periods.", + Create: resourceSonarqubeNewCodePeriodsCreate, + Read: resourceSonarqubeNewCodePeriodsRead, + Update: resourceSonarqubeNewCodePeriodsCreate, + Delete: resourceSonarqubeNewCodePeriodsDelete, // Define the fields of this schema. Schema: map[string]*schema.Schema{ @@ -47,20 +48,24 @@ func resourceSonarqubeNewCodePeriodsBinding() *schema.Resource { Optional: true, ForceNew: true, RequiredWith: []string{"project"}, + Description: "The name of a branch of a project for which the new code period will be configured. Changing this will force a new resource to be created. Setting this also requires setting the 'project' argument.", }, "project": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Description: "The key of a project for which the new code period will be configured. Changing this will force a new resource to be created.", }, "type": { Type: schema.TypeString, Required: true, ValidateDiagFunc: validation.ToDiagFunc(validation.StringInSlice([]string{string(SpecificAnalysis), string(PreviousVersion), string(NumberOfDays), string(ReferenceBranch)}, false)), + Description: "The kind of new code period to use. Supported values are SPECIFIC_ANALYSIS, PREVIOUS_VERSION, NUMBER_OF_DAYS, or REFERENCE_BRANCH.", }, "value": { - Type: schema.TypeString, - Optional: true, + Type: schema.TypeString, + Optional: true, + Description: "The desired value of the new code period. Varies based on the 'type'. For SPECIFIC_ANALYIS, the value must be the UUID of a previous analysis. For NUMBER_OF_DAYS it must be a numeric string. For REFERENCE_BRANCH it should be the name of branch on the project. For PREVIOUS_VERSION it must **not** be set.", }, }, } diff --git a/sonarqube/resource_sonarqube_permissions.go b/sonarqube/resource_sonarqube_permissions.go index 6c83ac5b..a630193f 100644 --- a/sonarqube/resource_sonarqube_permissions.go +++ b/sonarqube/resource_sonarqube_permissions.go @@ -28,9 +28,10 @@ type GroupPermission struct { // Returns the resource represented by this file. func resourceSonarqubePermissions() *schema.Resource { return &schema.Resource{ - Create: resourceSonarqubePermissionsCreate, - Read: resourceSonarqubePermissionsRead, - Delete: resourceSonarqubePermissionsDelete, + Description: "Provides a Sonarqube Permissions resource. This can be used to manage global and project permissions.", + Create: resourceSonarqubePermissionsCreate, + Read: resourceSonarqubePermissionsRead, + Delete: resourceSonarqubePermissionsDelete, // Define the fields of this schema. Schema: map[string]*schema.Schema{ @@ -39,30 +40,35 @@ func resourceSonarqubePermissions() *schema.Resource { Optional: true, ForceNew: true, ExactlyOneOf: []string{"login_name", "group_name"}, + Description: "The name of the user that should get the specified permissions. Changing this forces a new resource to be created. Cannot be used with `group_name`.", }, "group_name": { Type: schema.TypeString, Optional: true, ForceNew: true, ExactlyOneOf: []string{"login_name", "group_name"}, + Description: "The name of the Group that should get the specified permissions. Changing this forces a new resource to be created. Cannot be used with `login_name`", }, "project_key": { Type: schema.TypeString, ForceNew: true, Optional: true, ConflictsWith: []string{"template_id", "template_name"}, + Description: "Specify if you want to apply project level permissions. Changing this forces a new resource to be created. Cannot be used with `template_id & template_name`", }, "template_id": { Type: schema.TypeString, ForceNew: true, Optional: true, ConflictsWith: []string{"project_key", "template_name"}, + Description: "Specify if you want to apply the permissions to a permission template. Changing this forces a new resource to be created. Cannot be used with `project_key & template_name`", }, "template_name": { Type: schema.TypeString, ForceNew: true, Optional: true, ConflictsWith: []string{"project_key", "template_id"}, + Description: "Specify if you want to apply the permissions to a permission template. Changing this forces a new resource to be created. Cannot be used with `project_key & template_id`", }, "permissions": { Type: schema.TypeList, @@ -72,13 +78,13 @@ func resourceSonarqubePermissions() *schema.Resource { Elem: &schema.Schema{ Type: schema.TypeString, }, + Description: "A list of permissions that should be applied. Changing this forces a new resource to be created. Possible values are: `admin`, `codeviewer`, `issueadmin`, `securityhotspotadmin`, `scan`, `user`.", }, }, } } func resourceSonarqubePermissionsCreate(d *schema.ResourceData, m interface{}) error { - sonarQubeURL := m.(*ProviderConfiguration).sonarQubeURL permissions := expandPermissions(d) diff --git a/sonarqube/resource_sonarqube_permissions_template.go b/sonarqube/resource_sonarqube_permissions_template.go index b03dab9f..1e375cf8 100644 --- a/sonarqube/resource_sonarqube_permissions_template.go +++ b/sonarqube/resource_sonarqube_permissions_template.go @@ -33,6 +33,8 @@ type PermissionTemplate struct { // Returns the resource represented by this file. func resourceSonarqubePermissionTemplate() *schema.Resource { return &schema.Resource{ + Description: `Provides a Sonarqube Permission template resource. This can be used to create and manage Sonarqube Permission +templates.`, Create: resourceSonarqubePermissionTemplateCreate, Read: resourceSonarqubePermissionTemplateRead, Update: resourceSonarqubePermissionTemplateUpdate, @@ -44,21 +46,25 @@ func resourceSonarqubePermissionTemplate() *schema.Resource { // Define the fields of this schema. Schema: map[string]*schema.Schema{ "name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "The name of the Permission template to create. Do not use names with `/`. If needed, use `replace(var.permission_template_name, \"/\", \"_\")`. Changing this forces a new resource to be created.", }, "description": { - Type: schema.TypeString, - Optional: true, + Type: schema.TypeString, + Optional: true, + Description: "Description of the Template.", }, "project_key_pattern": { - Type: schema.TypeString, - Optional: true, + Type: schema.TypeString, + Optional: true, + Description: "The project key pattern. Must be a valid Java regular expression.", }, "default": { - Type: schema.TypeBool, - Optional: true, + Type: schema.TypeBool, + Optional: true, + Description: "Set the template as the default. This can only be set for one template.", }, }, } @@ -151,7 +157,6 @@ func resourceSonarqubePermissionTemplateRead(d *schema.ResourceData, m interface } return fmt.Errorf("resourceSonarqubePermissionTemplateRead: Failed to find template with ID: %+v", d.Id()) - } func resourceSonarqubePermissionTemplateUpdate(d *schema.ResourceData, m interface{}) error { diff --git a/sonarqube/resource_sonarqube_plugins.go b/sonarqube/resource_sonarqube_plugins.go index f4549e70..7696cb0f 100644 --- a/sonarqube/resource_sonarqube_plugins.go +++ b/sonarqube/resource_sonarqube_plugins.go @@ -38,9 +38,10 @@ type Plugin struct { // Returns the resource represented by this file. func resourceSonarqubePlugin() *schema.Resource { return &schema.Resource{ - Create: resourceSonarqubePluginCreate, - Read: resourceSonarqubePluginRead, - Delete: resourceSonarqubePluginDelete, + Description: "Provides a Sonarqube Plugin resource. This can be used to create and manage Sonarqube Plugins.", + Create: resourceSonarqubePluginCreate, + Read: resourceSonarqubePluginRead, + Delete: resourceSonarqubePluginDelete, Importer: &schema.ResourceImporter{ State: resourceSonarqubePluginImport, }, @@ -48,9 +49,10 @@ func resourceSonarqubePlugin() *schema.Resource { // Define the fields of this schema. Schema: map[string]*schema.Schema{ "key": { - Type: schema.TypeString, - Required: true, - ForceNew: true, + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "The key identifying the plugin to uninstall.", }, }, } diff --git a/sonarqube/resource_sonarqube_portfolio.go b/sonarqube/resource_sonarqube_portfolio.go index 53806241..eaab879f 100644 --- a/sonarqube/resource_sonarqube_portfolio.go +++ b/sonarqube/resource_sonarqube_portfolio.go @@ -46,10 +46,11 @@ const ( // Returns the resource represented by this file. func resourceSonarqubePortfolio() *schema.Resource { return &schema.Resource{ - Create: resourceSonarqubePortfolioCreate, - Read: resourceSonarqubePortfolioRead, - Update: resourceSonarqubePortfolioUpdate, - Delete: resourceSonarqubePortfolioDelete, + Description: "Provides a Sonarqube Portfolio resource. This can be used to create and manage Sonarqube Portfolio. Note that the SonarQube API for Portfolios is called ``views``", + Create: resourceSonarqubePortfolioCreate, + Read: resourceSonarqubePortfolioRead, + Update: resourceSonarqubePortfolioUpdate, + Delete: resourceSonarqubePortfolioDelete, Importer: &schema.ResourceImporter{ State: resourceSonarqubePortfolioImport, }, @@ -63,19 +64,22 @@ func resourceSonarqubePortfolio() *schema.Resource { // Define the fields of this schema. Schema: map[string]*schema.Schema{ "key": { - Type: schema.TypeString, - Required: true, - ForceNew: true, + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "The key of the Portfolio to create", }, "name": { - Type: schema.TypeString, - Required: true, - ForceNew: false, + Type: schema.TypeString, + Required: true, + ForceNew: false, + Description: "The name of the Portfolio to create", }, "description": { - Type: schema.TypeString, - Required: true, - ForceNew: false, + Type: schema.TypeString, + Required: true, + ForceNew: false, + Description: "A description of the Portfolio to create", }, "qualifier": { Type: schema.TypeString, @@ -87,6 +91,7 @@ func resourceSonarqubePortfolio() *schema.Resource { Default: "public", ForceNew: true, // TODO: There currently isn't an API to update this in-place, even though it's possible in the UI ValidateFunc: validation.StringInSlice([]string{"public", "private"}, false), + Description: "Whether the created portfolio should be visible to everyone, or only specific user/groups. If no visibility is specified, the default portfolio visibility will be `public`.", }, "selection_mode": { Type: schema.TypeString, @@ -94,6 +99,7 @@ func resourceSonarqubePortfolio() *schema.Resource { Default: NONE, ForceNew: false, ValidateFunc: validation.StringInSlice([]string{NONE, MANUAL, TAGS, REGEXP, REST}, false), + Description: "How to populate the Portfolio to create. Possible values are `NONE`, `MANUAL`, `TAGS`, `REGEXP` or `REST`. [See docs](https://docs.sonarqube.org/9.8/project-administration/managing-portfolios/#populating-portfolios) for how Portfolio population works", }, "branch": { // Only active for TAGS, REGEXP and REST Type: schema.TypeString, @@ -109,6 +115,7 @@ func resourceSonarqubePortfolio() *schema.Resource { Elem: &schema.Schema{ Type: schema.TypeString, }, + Description: "List of Project tags to populate the Portfolio from. Only active when `selection_mode` is `TAGS`", }, "regexp": { // Only active for REGEXP Type: schema.TypeString, @@ -116,6 +123,7 @@ func resourceSonarqubePortfolio() *schema.Resource { ForceNew: false, ConflictsWith: []string{"selected_projects", "tags"}, ValidateFunc: validation.StringIsValidRegExp, + Description: "A regular expression that is used to match Projects with a matching name OR key. If they match, they are added to the Portfolio", }, "selected_projects": { Type: schema.TypeSet, @@ -139,6 +147,7 @@ func resourceSonarqubePortfolio() *schema.Resource { }, }, }, + Description: "Block set of projects to add to the portfolio. Only active when `selection_mode` is `MANUAL`. See [below for nested schema](#selected_projects)", }, }, }, @@ -190,7 +199,6 @@ func validatePortfolioResource(d *schema.ResourceDiff) error { default: return fmt.Errorf("resourceSonarqubePortfolioCreate: selection_mode needs to be set to one of NONE, MANUAL, TAGS, REGEXP, REST") } - } func portfolioSetSelectionMode(d *schema.ResourceData, m interface{}, sonarQubeURL url.URL) error { @@ -423,7 +431,6 @@ func resourceSonarqubePortfolioImport(d *schema.ResourceData, m interface{}) ([] } func updateResourceDataFromPortfolioReadResponse(d *schema.ResourceData, portfolioReadResponse *Portfolio) { - d.SetId(portfolioReadResponse.Key) d.Set("key", portfolioReadResponse.Key) d.Set("name", portfolioReadResponse.Name) @@ -446,7 +453,6 @@ func updateResourceDataFromPortfolioReadResponse(d *schema.ResourceData, portfol if len(portfolioReadResponse.SelectedProjects) > 0 { d.Set("selected_projects", flattenReadPortfolioSelectedProjectsResponse(&portfolioReadResponse.SelectedProjects)) } - } func readPortfolioFromApi(d *schema.ResourceData, m interface{}) (*Portfolio, error) { diff --git a/sonarqube/resource_sonarqube_project.go b/sonarqube/resource_sonarqube_project.go index b61d7fff..05aede85 100644 --- a/sonarqube/resource_sonarqube_project.go +++ b/sonarqube/resource_sonarqube_project.go @@ -42,10 +42,11 @@ type CreateProjectResponse struct { // Returns the resource represented by this file. func resourceSonarqubeProject() *schema.Resource { return &schema.Resource{ - Create: resourceSonarqubeProjectCreate, - Read: resourceSonarqubeProjectRead, - Update: resourceSonarqubeProjectUpdate, - Delete: resourceSonarqubeProjectDelete, + Description: "Provides a Sonarqube Project resource. This can be used to create and manage Sonarqube Project.", + Create: resourceSonarqubeProjectCreate, + Read: resourceSonarqubeProjectRead, + Update: resourceSonarqubeProjectUpdate, + Delete: resourceSonarqubeProjectDelete, Importer: &schema.ResourceImporter{ State: resourceSonarqubeProjectImport, }, @@ -53,18 +54,21 @@ func resourceSonarqubeProject() *schema.Resource { // Define the fields of this schema. Schema: map[string]*schema.Schema{ "name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "The name of the Project to create", }, "project": { - Type: schema.TypeString, - Required: true, + Type: schema.TypeString, + Required: true, + Description: "Key of the project. Maximum length 400. All letters, digits, dash, underscore, period or colon.", }, "visibility": { - Type: schema.TypeString, - Optional: true, - Default: "public", + Type: schema.TypeString, + Optional: true, + Default: "public", + Description: "Whether the created project should be visible to everyone, or only specific user/groups. If no visibility is specified, the default project visibility of the organization will be used. Valid values are `public` and `private`.", }, "tags": { Type: schema.TypeList, @@ -73,6 +77,7 @@ func resourceSonarqubeProject() *schema.Resource { Elem: &schema.Schema{ Type: schema.TypeString, }, + Description: "A list of tags to put on the project.", }, "setting": { Type: schema.TypeList, @@ -109,6 +114,7 @@ func resourceSonarqubeProject() *schema.Resource { }, }, }, + Description: "The definition of a Setting to be used by this Portfolio as documented in the `setting` block below.", }, }, }, @@ -252,7 +258,6 @@ func resourceSonarqubeProjectRead(d *schema.ResourceData, m interface{}) error { } func resourceSonarqubeProjectUpdate(d *schema.ResourceData, m interface{}) error { - // handle default updates (api/users/update) if d.HasChange("visibility") { sonarQubeURL := m.(*ProviderConfiguration).sonarQubeURL diff --git a/sonarqube/resource_sonarqube_project_main_branch.go b/sonarqube/resource_sonarqube_project_main_branch.go index 0bf0a794..f24b9416 100644 --- a/sonarqube/resource_sonarqube_project_main_branch.go +++ b/sonarqube/resource_sonarqube_project_main_branch.go @@ -29,23 +29,26 @@ type Branches struct { // Returns the resource represented by this file. func resourceSonarqubeProjectMainBranch() *schema.Resource { return &schema.Resource{ - Create: resourceSonarqubeProjectMainBranchCreate, - Read: resourceSonarqubeProjectMainBranchRead, - Delete: resourceSonarqubeProjectMainBranchDelete, + Description: "Provides a Sonarqube Project main branch resource. This can be used to create and manage a Sonarqube Projects main branch.", + Create: resourceSonarqubeProjectMainBranchCreate, + Read: resourceSonarqubeProjectMainBranchRead, + Delete: resourceSonarqubeProjectMainBranchDelete, Importer: &schema.ResourceImporter{ State: resourceSonarqubeProjectMainBranchImport, }, // Define the fields of this schema. Schema: map[string]*schema.Schema{ "name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "The name you want the main branch to have.", }, "project": { - Type: schema.TypeString, - Required: true, - ForceNew: true, + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "Key of the project. Maximum length 400. All letters, digits, dash, underscore, period or colon.", }, }, } @@ -113,7 +116,6 @@ func resourceSonarqubeProjectMainBranchRead(d *schema.ResourceData, m interface{ } } return fmt.Errorf("resourceSonarqubeProjectMainBranchRead: Failed to find project main branch: %+v", d.Id()) - } // TODO make the delete function read the default branch name of the sonarQube instance instead of assuming diff --git a/sonarqube/resource_sonarqube_qualitygate.go b/sonarqube/resource_sonarqube_qualitygate.go index b3b5024a..289db591 100644 --- a/sonarqube/resource_sonarqube_qualitygate.go +++ b/sonarqube/resource_sonarqube_qualitygate.go @@ -47,10 +47,11 @@ type CreateQualityGateResponse struct { // Returns the resource represented by this file. func resourceSonarqubeQualityGate() *schema.Resource { return &schema.Resource{ - Create: resourceSonarqubeQualityGateCreate, - Read: resourceSonarqubeQualityGateRead, - Update: resourceSonarqubeQualityGateUpdate, - Delete: resourceSonarqubeQualityGateDelete, + Description: "Provides a Sonarqube Quality Gate resource. This can be used to create and manage Sonarqube Quality Gates and their Conditions.", + Create: resourceSonarqubeQualityGateCreate, + Read: resourceSonarqubeQualityGateRead, + Update: resourceSonarqubeQualityGateUpdate, + Delete: resourceSonarqubeQualityGateDelete, Importer: &schema.ResourceImporter{ State: resourceSonarqubeQualityGateImport, }, @@ -58,25 +59,27 @@ func resourceSonarqubeQualityGate() *schema.Resource { // Define the fields of this schema. Schema: map[string]*schema.Schema{ "name": { - Type: schema.TypeString, - Required: true, + Type: schema.TypeString, + Required: true, + Description: "The name of the Quality Gate to create. Maximum length 100.", }, "copy_from": { Type: schema.TypeString, Optional: true, ForceNew: true, ConflictsWith: []string{"condition"}, + Description: "Name of an existing Quality Gate to copy from.", }, "is_default": { Type: schema.TypeBool, Optional: true, - Description: "When set to true this Quality Gate is set as default", + Description: "When set to true this Quality Gate is set as default.", Default: false, }, "condition": { Type: schema.TypeList, Optional: true, - Description: "A list of conditions that the gate uses", + Description: "A list of conditions that the gate uses.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "id": { @@ -86,14 +89,33 @@ func resourceSonarqubeQualityGate() *schema.Resource { "metric": { Type: schema.TypeString, Required: true, + Description: `Condition metric. + + Only metrics of the following types are allowed: + + - INT + - MILLISEC + - RATING + - WORK_DUR + - FLOAT + - PERCENT + - LEVEL. + + The following metrics are forbidden: + + - alert_status + - security_hotspots + - new_security_hotspots`, }, "op": { - Type: schema.TypeString, - Required: true, + Type: schema.TypeString, + Required: true, + Description: "Condition operator. Possible values are: LT and GT", }, "threshold": { - Type: schema.TypeString, - Required: true, + Type: schema.TypeString, + Required: true, + Description: "Condition error threshold (For ratings: A=1, B=2, C=3, D=4)", }, }, }, @@ -355,7 +377,6 @@ func readQualityGateFromApi(d *schema.ResourceData, m interface{}) (*GetQualityG } func synchronizeConditions(d *schema.ResourceData, m interface{}, apiQualityGateConditions *[]ReadQualityGateConditionsResponse) (bool, error) { - changed := false qualityGateConditions := d.Get("condition").([]interface{}) @@ -448,7 +469,6 @@ func updateResourceDataFromQualityGateReadResponse(d *schema.ResourceData, quali } func createCondition(qualityGateName string, metric string, op string, threshold string, m interface{}) (string, error) { - sonarQubeURL := m.(*ProviderConfiguration).sonarQubeURL sonarQubeURL.Path = strings.TrimSuffix(sonarQubeURL.Path, "/") + "/api/qualitygates/create_condition" @@ -482,7 +502,6 @@ func createCondition(qualityGateName string, metric string, op string, threshold } func updateCondition(id, metric, op, threshold string, m interface{}) error { - sonarQubeURL := m.(*ProviderConfiguration).sonarQubeURL sonarQubeURL.Path = strings.TrimSuffix(sonarQubeURL.Path, "/") + "/api/qualitygates/update_condition" diff --git a/sonarqube/resource_sonarqube_qualitygate_project_association.go b/sonarqube/resource_sonarqube_qualitygate_project_association.go index a16ee15b..5840c44c 100644 --- a/sonarqube/resource_sonarqube_qualitygate_project_association.go +++ b/sonarqube/resource_sonarqube_qualitygate_project_association.go @@ -22,9 +22,10 @@ type GetQualityGateAssociation struct { // Returns the resource represented by this file. func resourceSonarqubeQualityGateProjectAssociation() *schema.Resource { return &schema.Resource{ - Create: resourceSonarqubeQualityGateProjectAssociationCreate, - Read: resourceSonarqubeQualityGateProjectAssociationRead, - Delete: resourceSonarqubeQualityGateProjectAssociationDelete, + Description: "Provides a Sonarqube Quality Gate Project association resource. This can be used to associate a Quality Gate to a Project", + Create: resourceSonarqubeQualityGateProjectAssociationCreate, + Read: resourceSonarqubeQualityGateProjectAssociationRead, + Delete: resourceSonarqubeQualityGateProjectAssociationDelete, Importer: &schema.ResourceImporter{ State: resourceSonarqubeQualityGateProjectAssociationImport, }, @@ -37,14 +38,16 @@ func resourceSonarqubeQualityGateProjectAssociation() *schema.Resource { ForceNew: true, }, "gatename": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Description: "The name of the Quality Gate", }, "projectkey": { - Type: schema.TypeString, - Required: true, - ForceNew: true, + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "Key of the project. Maximum length 400. All letters, digits, dash, underscore, period or colon.", }, }, } diff --git a/sonarqube/resource_sonarqube_qualitygate_usergroup_association.go b/sonarqube/resource_sonarqube_qualitygate_usergroup_association.go index 70b48db6..a66a8750 100644 --- a/sonarqube/resource_sonarqube_qualitygate_usergroup_association.go +++ b/sonarqube/resource_sonarqube_qualitygate_usergroup_association.go @@ -29,6 +29,8 @@ type GetQualityGateUsergroupAssociationProjects struct { // Returns the resource represented by this file. func resourceSonarqubeQualityGateUsergroupAssociation() *schema.Resource { return &schema.Resource{ + Description: `Provides a Sonarqube Quality Gate Usergroup association resource. This can be used to associate a Quality Gate to an User or to a Group. +The feature is available on SonarQube 9.2 or newer.`, Create: resourceSonarqubeQualityGateUsergroupAssociationCreate, Read: resourceSonarqubeQualityGateUsergroupAssociationRead, Delete: resourceSonarqubeQualityGateUsergroupAssociationDelete, @@ -40,17 +42,20 @@ func resourceSonarqubeQualityGateUsergroupAssociation() *schema.Resource { Optional: true, ForceNew: true, ExactlyOneOf: []string{"login_name", "group_name"}, + Description: "The name of the User to associate. Either `group_name` or `login_name` should be provided.", }, "group_name": { Type: schema.TypeString, Optional: true, ForceNew: true, ExactlyOneOf: []string{"login_name", "group_name"}, + Description: "The name of the Group to associate. Either `group_name` or `login_name` should be provided.", }, "gatename": { - Type: schema.TypeString, - Required: true, - ForceNew: true, + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "The name of the Quality Gate", }, }, } diff --git a/sonarqube/resource_sonarqube_qualityprofile.go b/sonarqube/resource_sonarqube_qualityprofile.go index 48a22259..13aa3dce 100644 --- a/sonarqube/resource_sonarqube_qualityprofile.go +++ b/sonarqube/resource_sonarqube_qualityprofile.go @@ -60,9 +60,10 @@ type GetQualityProfileActions struct { // Returns the resource represented by this file. func resourceSonarqubeQualityProfile() *schema.Resource { return &schema.Resource{ - Create: resourceSonarqubeQualityProfileCreate, - Read: resourceSonarqubeQualityProfileRead, - Delete: resourceSonarqubeQualityProfileDelete, + Description: "Provides a Sonarqube Quality Profile resource. This can be used to create and manage Sonarqube Quality Profiles.", + Create: resourceSonarqubeQualityProfileCreate, + Read: resourceSonarqubeQualityProfileRead, + Delete: resourceSonarqubeQualityProfileDelete, Importer: &schema.ResourceImporter{ State: resourceSonarqubeQualityProfileImport, }, @@ -73,33 +74,34 @@ func resourceSonarqubeQualityProfile() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, - Description: "Quality profile name", + Description: "The name of the Quality Profile to create. Maximum length 100", ValidateDiagFunc: validation.ToDiagFunc( validation.StringLenBetween(0, 100), ), }, "key": { Type: schema.TypeString, - Description: "Quality profile key", + Description: "ID of the Sonarqube Quality Profile", Computed: true, }, "language": { Type: schema.TypeString, Required: true, ForceNew: true, - Description: "Quality profile language", + Description: "Quality profile language. Must be one of \"cs\", \"css\", \"flex\", \"go\", \"java\", \"js\", \"jsp\", \"kotlin\", \"php\", \"py\", \"ruby\", \"scala\", \"ts\", \"vbnet\", \"web\", \"xml\"", }, "is_default": { Type: schema.TypeBool, Optional: true, - Description: "Is the default profile", + Description: "When set to true this will make the added Quality Profile default", Default: false, ForceNew: true, }, "parent": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Description: "When a parent is provided the quality profile will inherit it's rules", }, }, } @@ -195,7 +197,6 @@ func resourceSonarqubeQualityProfileDelete(d *schema.ResourceData, m interface{} }.Encode() err := setDefaultQualityProfile(d, m, false) - if err != nil { return err } @@ -213,7 +214,6 @@ func resourceSonarqubeQualityProfileDelete(d *schema.ResourceData, m interface{} defer resp.Body.Close() return nil - } func resourceSonarqubeQualityProfileImport(d *schema.ResourceData, m interface{}) ([]*schema.ResourceData, error) { diff --git a/sonarqube/resource_sonarqube_qualityprofile_activate_rule.go b/sonarqube/resource_sonarqube_qualityprofile_activate_rule.go index f8efc1f2..07e514b9 100644 --- a/sonarqube/resource_sonarqube_qualityprofile_activate_rule.go +++ b/sonarqube/resource_sonarqube_qualityprofile_activate_rule.go @@ -25,9 +25,10 @@ type GetActiveRules struct { func resourceSonarqubeQualityProfileRule() *schema.Resource { return &schema.Resource{ - Create: resourceSonarqubeQualityProfileRuleCreate, - Delete: resourceSonarqubeQualityProfileRuleDelete, - Read: resourceSonarqubeQualityProfileRuleRead, + Description: "Provides a Sonarqube Rules resource. This can be used to manage Sonarqube rules.", + Create: resourceSonarqubeQualityProfileRuleCreate, + Delete: resourceSonarqubeQualityProfileRuleDelete, + Read: resourceSonarqubeQualityProfileRuleRead, Importer: &schema.ResourceImporter{ State: resourceSonarqubeQualityProfileRuleImporter, }, @@ -49,11 +50,12 @@ func resourceSonarqubeQualityProfileRule() *schema.Resource { }, }, "reset": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - Description: "Reset severity and parameters of activated rule. Set the values defined on parent profile or from rule default values.", - Default: "false", + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Description: `Reset severity and parameters of activated rule. Set the values defined on parent profile or from rule default values. + - Possible values true false yes no (Default false)`, + Default: "false", ValidateDiagFunc: validation.ToDiagFunc( validation.StringInSlice( []string{"true", "false", "yes", "no"}, @@ -68,10 +70,11 @@ func resourceSonarqubeQualityProfileRule() *schema.Resource { Description: "Rule key", }, "severity": { - Type: schema.TypeString, - Optional: true, - Description: "Rule severity", - ForceNew: true, + Type: schema.TypeString, + Optional: true, + Description: `Severity. Ignored if parameter reset is true. + - Possible values - INFO, MINOR, MAJOR, CRITICAL, BLOCKER`, + ForceNew: true, ValidateDiagFunc: validation.ToDiagFunc( validation.StringInSlice( []string{"INFO", "MINOR", "MAJOR", "CRITICAL", "BLOCKER"}, @@ -148,7 +151,6 @@ func resourceSonarqubeQualityProfileRuleRead(d *schema.ResourceData, m interface http.StatusOK, "resourceSonarqubeQualityProfileRuleRead", ) - if err != nil { return err } diff --git a/sonarqube/resource_sonarqube_qualityprofile_project_association.go b/sonarqube/resource_sonarqube_qualityprofile_project_association.go index 9425687b..87559c35 100644 --- a/sonarqube/resource_sonarqube_qualityprofile_project_association.go +++ b/sonarqube/resource_sonarqube_qualityprofile_project_association.go @@ -28,9 +28,10 @@ type GetQualityProfileProjectAssociationResults struct { // Returns the resource represented by this file. func resourceSonarqubeQualityProfileProjectAssociation() *schema.Resource { return &schema.Resource{ - Create: resourceSonarqubeQualityProfileProjectAssociationCreate, - Read: resourceSonarqubeQualityProfileProjectAssociationRead, - Delete: resourceSonarqubeQualityProfileProjectAssociationDelete, + Description: "Provides a Sonarqube Quality Profile Project association resource. This can be used to associate a Quality Profile to a Project", + Create: resourceSonarqubeQualityProfileProjectAssociationCreate, + Read: resourceSonarqubeQualityProfileProjectAssociationRead, + Delete: resourceSonarqubeQualityProfileProjectAssociationDelete, Importer: &schema.ResourceImporter{ State: resourceSonarqubeQualityProfileProjectAssociationImport, }, @@ -41,7 +42,7 @@ func resourceSonarqubeQualityProfileProjectAssociation() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, - Description: "Quality profile name", + Description: "Name of the Quality Profile", ValidateDiagFunc: validation.ToDiagFunc( validation.StringLenBetween(0, 100), ), @@ -50,7 +51,7 @@ func resourceSonarqubeQualityProfileProjectAssociation() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, - Description: "Project key", + Description: "Name of the project", ValidateDiagFunc: validation.ToDiagFunc( validation.StringLenBetween(0, 100), ), @@ -59,7 +60,7 @@ func resourceSonarqubeQualityProfileProjectAssociation() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, - Description: "Quality profile language", + Description: "Quality profile language. Must be a langauge in this list https://next.sonarqube.com/sonarqube/web_api/api/languages/list", }, }, } @@ -173,7 +174,6 @@ func resourceSonarqubeQualityProfileProjectAssociationRead(d *schema.ResourceDat } return fmt.Errorf("resourceSonarqubeQualityProfileProjectAssociationRead: Failed to find project association: %+v", d.Id()) - } func resourceSonarqubeQualityProfileProjectAssociationDelete(d *schema.ResourceData, m interface{}) error { @@ -198,7 +198,6 @@ func resourceSonarqubeQualityProfileProjectAssociationDelete(d *schema.ResourceD defer resp.Body.Close() return nil - } func resourceSonarqubeQualityProfileProjectAssociationImport(d *schema.ResourceData, m interface{}) ([]*schema.ResourceData, error) { diff --git a/sonarqube/resource_sonarqube_rules.go b/sonarqube/resource_sonarqube_rules.go index 8c6db62c..f43d6499 100644 --- a/sonarqube/resource_sonarqube_rules.go +++ b/sonarqube/resource_sonarqube_rules.go @@ -54,10 +54,11 @@ type CreateRuleResponse struct { func resourceSonarqubeRule() *schema.Resource { return &schema.Resource{ - Create: resourceSonarqubeRuleCreate, - Read: resourceSonarqubeRuleRead, - Update: resourceSonarqubeRuleUpdate, - Delete: resourceSonarqubeRuleDelete, + Description: "Provides a Sonarqube Rules resource. This can be used to manage Sonarqube rules.", + Create: resourceSonarqubeRuleCreate, + Read: resourceSonarqubeRuleRead, + Update: resourceSonarqubeRuleUpdate, + Delete: resourceSonarqubeRuleDelete, Importer: &schema.ResourceImporter{ State: resourceSonarqubeRuleImporter, }, @@ -67,7 +68,7 @@ func resourceSonarqubeRule() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, - Description: "Key of the custom rule", + Description: "key of the custom rule should only contain : a-z, 0-9, \\_", ValidateDiagFunc: validation.ToDiagFunc( validation.StringLenBetween(0, 200), ), @@ -87,18 +88,20 @@ func resourceSonarqubeRule() *schema.Resource { ), }, "params": { - Type: schema.TypeString, - Optional: true, - Description: "Parameters as semi-colon list of =, for example 'params=key1=v1;key2=v2' (Only for custom rule)", + Type: schema.TypeString, + Optional: true, + Description: `Parameters as semi-colon list of =, for example 'params=key1=v1;key2=v2' (Only for custom rule) + - parameter order: expression=value;filePattern=value;message=value`, Elem: &schema.Schema{ Type: schema.TypeString, }, }, "prevent_reactivation": { - Type: schema.TypeString, - Optional: true, - Description: "If set to true and if the rule has been deactivated (status 'REMOVED'), a status 409 will be returned", - Default: "false", + Type: schema.TypeString, + Optional: true, + Description: `If set to true and if the rule has been deactivated (status 'REMOVED'), a status 409 will be returned + - Possible values - true, false, yes, no`, + Default: "false", ValidateDiagFunc: validation.ToDiagFunc( validation.StringInSlice( []string{"true", "false", "yes", "no"}, @@ -107,9 +110,10 @@ func resourceSonarqubeRule() *schema.Resource { ), }, "severity": { - Type: schema.TypeString, - Optional: true, - Description: "Rule severity", + Type: schema.TypeString, + Optional: true, + Description: `Rule severity + - Possible values - INFO, MINOR, MAJOR, CRITICAL, BLOCKER`, ValidateDiagFunc: validation.ToDiagFunc( validation.StringInSlice( []string{"INFO", "MINOR", "MAJOR", "CRITICAL", "BLOCKER"}, @@ -118,10 +122,12 @@ func resourceSonarqubeRule() *schema.Resource { ), }, "status": { - Type: schema.TypeString, - Optional: true, - Description: "Rule status", - Default: "READY", + Type: schema.TypeString, + Optional: true, + Description: `Rule status + - Possible values - BETA, DEPRECATED, READY, REMOVED + - Default value - READY`, + Default: "READY", ValidateDiagFunc: validation.ToDiagFunc( validation.StringInSlice( []string{"BETA", "DEPRECATED", "READY", "REMOVED"}, @@ -130,14 +136,16 @@ func resourceSonarqubeRule() *schema.Resource { ), }, "template_key": { - Type: schema.TypeString, - Required: true, - Description: "Key of the template rule in order to create a custom rule (mandatory for custom rule)", + Type: schema.TypeString, + Required: true, + Description: `Key of the template rule in order to create a custom rule (mandatory for custom rule) + - [Example values](https://docs.sonarqube.org/latest/user-guide/rules/#header-4)`, }, "type": { - Type: schema.TypeString, - Optional: true, - Description: "Rule type", + Type: schema.TypeString, + Optional: true, + Description: `Rule type + - Possible values - CODE_SMELL, BUG, VULNERABILITY, SECURITY_HOTSPOT`, ValidateDiagFunc: validation.ToDiagFunc( validation.StringInSlice( []string{"CODE_SMELL", "BUG", "VULNERABILITY", "SECURITY_HOTSPOT"}, diff --git a/sonarqube/resource_sonarqube_setting.go b/sonarqube/resource_sonarqube_setting.go index c9125a9f..5c77a511 100644 --- a/sonarqube/resource_sonarqube_setting.go +++ b/sonarqube/resource_sonarqube_setting.go @@ -41,10 +41,11 @@ func (a Setting) ToMap() map[string]interface{} { func resourceSonarqubeSettings() *schema.Resource { return &schema.Resource{ - Create: resourceSonarqubeSettingsCreate, - Read: resourceSonarqubeSettingsRead, - Update: resourceSonarqubeSettingsUpdate, - Delete: resourceSonarqubeSettingsDelete, + Description: "Provides a Sonarqube Settings resource. This can be used to manage Sonarqube settings.", + Create: resourceSonarqubeSettingsCreate, + Read: resourceSonarqubeSettingsRead, + Update: resourceSonarqubeSettingsUpdate, + Delete: resourceSonarqubeSettingsDelete, Importer: &schema.ResourceImporter{ State: resourceSonarqubeSettingsImporter, }, @@ -193,6 +194,7 @@ func resourceSonarqubeSettingsUpdate(d *schema.ResourceData, m interface{}) erro return resourceSonarqubeSettingsRead(d, m) } + func getCreateOrUpdateQueryRawQuery(key []string, d *schema.ResourceData) string { // build the base query RawQuery := url.Values{ @@ -430,7 +432,6 @@ func removeComponentSettings(component string, newSettings []interface{}, apiPro http.StatusNoContent, "deleteSetting", ) - if err != nil { return fmt.Errorf("removeComponentSettings: Failed to delete setting %s: %+v", component, err) } diff --git a/sonarqube/resource_sonarqube_user.go b/sonarqube/resource_sonarqube_user.go index 004054e5..9419e1ab 100644 --- a/sonarqube/resource_sonarqube_user.go +++ b/sonarqube/resource_sonarqube_user.go @@ -35,10 +35,11 @@ type CreateUserResponse struct { // Returns the resource represented by this file. func resourceSonarqubeUser() *schema.Resource { return &schema.Resource{ - Create: resourceSonarqubeUserCreate, - Read: resourceSonarqubeUserRead, - Update: resourceSonarqubeUserUpdate, - Delete: resourceSonarqubeUserDelete, + Description: "Provides a Sonarqube User resource. This can be used to manage Sonarqube Users.", + Create: resourceSonarqubeUserCreate, + Read: resourceSonarqubeUserRead, + Update: resourceSonarqubeUserUpdate, + Delete: resourceSonarqubeUserDelete, Importer: &schema.ResourceImporter{ State: resourceSonarqubeUserImport, }, @@ -46,29 +47,34 @@ func resourceSonarqubeUser() *schema.Resource { // Define the fields of this schema. Schema: map[string]*schema.Schema{ "login_name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "The login name of the User to create. Changing this forces a new resource to be created.", }, "name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "The name of the User to create. Changing this forces a new resource to be created.", }, "email": { - Type: schema.TypeString, - Optional: true, + Type: schema.TypeString, + Optional: true, + Description: "The email of the User to create.", }, "password": { - Type: schema.TypeString, - Optional: true, - Sensitive: true, + Type: schema.TypeString, + Optional: true, + Sensitive: true, + Description: "The password of User to create. This is only used if the user is of type `local`.", }, "is_local": { - Type: schema.TypeBool, - Optional: true, - Default: true, - ForceNew: true, + Type: schema.TypeBool, + Optional: true, + Default: true, + ForceNew: true, + Description: "`True` if the User should be of type `local`. Defaults to `true`.", }, }, } diff --git a/sonarqube/resource_sonarqube_user_external_identity.go b/sonarqube/resource_sonarqube_user_external_identity.go index d57541e0..098d73bc 100644 --- a/sonarqube/resource_sonarqube_user_external_identity.go +++ b/sonarqube/resource_sonarqube_user_external_identity.go @@ -13,6 +13,10 @@ import ( // Returns the resource represented by this file. func resourceSonarqubeUserExternalIdentity() *schema.Resource { return &schema.Resource{ + Description: `Updates the _external identity_ of a _non local_ Sonarqube User. This can be used to set the _Identity Provider_ which should be used to +authenticate a specific user. + +The Sonarqube API currently does not provide an endpoint to read the _external identity_ setting of an user.`, Create: resourceSonarqubeUserExternalIdentityCreate, Read: resourceSonarqubeUserExternalIdentityRead, Delete: resourceSonarqubeUserExternalIdentityDelete, @@ -20,19 +24,22 @@ func resourceSonarqubeUserExternalIdentity() *schema.Resource { // Define the fields of this schema. Schema: map[string]*schema.Schema{ "login_name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "The login name of the User to update. Changing this forces a new resource to be created.", }, "external_identity": { - Type: schema.TypeString, - Required: true, - ForceNew: true, + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "The identifier of the User used by the Authentication Provider. Changing this forces a new resource to be created.", }, "external_provider": { - Type: schema.TypeString, - Required: true, - ForceNew: true, + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "The key of the Authentication Provider. The Authentication Provider must be activated on Sonarqube. Changing this forces a new resource to be created.", }, }, } @@ -77,12 +84,10 @@ func resourceSonarqubeUserExternalIdentityCreate(d *schema.ResourceData, m inter } func resourceSonarqubeUserExternalIdentityRead(d *schema.ResourceData, m interface{}) error { - return nil } func resourceSonarqubeUserExternalIdentityDelete(d *schema.ResourceData, m interface{}) error { - return nil } diff --git a/sonarqube/resource_sonarqube_user_token.go b/sonarqube/resource_sonarqube_user_token.go index 6bf1c84e..47188e8b 100644 --- a/sonarqube/resource_sonarqube_user_token.go +++ b/sonarqube/resource_sonarqube_user_token.go @@ -47,9 +47,10 @@ const ( // Returns the resource represented by this file. func resourceSonarqubeUserToken() *schema.Resource { return &schema.Resource{ - Create: resourceSonarqubeUserTokenCreate, - Read: resourceSonarqubeUserTokenRead, - Delete: resourceSonarqubeUserTokenDelete, + Description: "Provides a Sonarqube User token resource. This can be used to manage Sonarqube User tokens.", + Create: resourceSonarqubeUserTokenCreate, + Read: resourceSonarqubeUserTokenRead, + Delete: resourceSonarqubeUserTokenDelete, // Define the fields of this schema. Schema: map[string]*schema.Schema{ @@ -58,22 +59,26 @@ func resourceSonarqubeUserToken() *schema.Resource { Required: true, ForceNew: true, ValidateDiagFunc: validation.ToDiagFunc(validation.StringLenBetween(1, 100)), + Description: "The name of the Token to create. Changing this forces a new resource to be created.", }, "login_name": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Description: "The login name of the User for which the token should be created. If not set, the token is created for the authenticated user. Changing this forces a new resource to be created.", }, "expiration_date": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - Computed: true, + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Computed: true, + Description: "The expiration date of the token being generated, in ISO 8601 format (YYYY-MM-DD). If not set, default to no expiration.", }, "token": { - Type: schema.TypeString, - Computed: true, - Sensitive: true, + Type: schema.TypeString, + Computed: true, + Sensitive: true, + Description: "The token value.", }, "type": { Type: schema.TypeString, @@ -81,11 +86,13 @@ func resourceSonarqubeUserToken() *schema.Resource { Default: UserToken, ForceNew: true, ValidateDiagFunc: validation.ToDiagFunc(validation.StringInSlice([]string{string(UserToken), string(GlobalAnalysisToken), string(ProjectAnalysisToken)}, false)), + Description: "The kind of Token to create. Changing this forces a new resource to be created. Possible values are USER_TOKEN, GLOBAL_ANALYSIS_TOKEN, or PROJECT_ANALYSIS_TOKEN. Defaults to USER_TOKEN. If set to PROJECT_ANALYSIS_TOKEN, then the project_key must also be specified.", }, "project_key": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Description: "The key of the only project that can be analyzed by the PROJECT_ANALYSIS TOKEN being created. Changing this forces a new resource to be created.", }, }, } diff --git a/sonarqube/resource_sonarqube_webhook.go b/sonarqube/resource_sonarqube_webhook.go index b2ef27d0..006c7c65 100644 --- a/sonarqube/resource_sonarqube_webhook.go +++ b/sonarqube/resource_sonarqube_webhook.go @@ -29,10 +29,11 @@ type ListWebhooksResponse struct { // Returns the resource represented by this file. func resourceSonarqubeWebhook() *schema.Resource { return &schema.Resource{ - Create: resourceSonarqubeWebhookCreate, - Read: resourceSonarqubeWebhookRead, - Update: resourceSonarqubeWebhookUpdate, - Delete: resourceSonarqubeWebhookDelete, + Description: "Provides a Sonarqube Webhook resource. This can be used to manage Sonarqube webhooks.", + Create: resourceSonarqubeWebhookCreate, + Read: resourceSonarqubeWebhookRead, + Update: resourceSonarqubeWebhookUpdate, + Delete: resourceSonarqubeWebhookDelete, Importer: &schema.ResourceImporter{ State: resourceSonarqubeWebhookImport, }, @@ -40,18 +41,21 @@ func resourceSonarqubeWebhook() *schema.Resource { // Define the fields of this schema. Schema: map[string]*schema.Schema{ "name": { - Type: schema.TypeString, - Required: true, + Type: schema.TypeString, + Required: true, + Description: "The name of the webhook to create. This will be displayed in the Sonarqube administration console.", }, "url": { - Type: schema.TypeString, - Required: true, + Type: schema.TypeString, + Required: true, + Description: "The URL to send event payloads to. This must begin with either `https://` or `http://`.", }, "secret": { - Type: schema.TypeString, - Sensitive: true, - Optional: true, - Computed: true, + Type: schema.TypeString, + Sensitive: true, + Optional: true, + Computed: true, + Description: "The secret to send with the event payload.", }, "project": { Type: schema.TypeString, diff --git a/templates/index.md.tmpl b/templates/index.md.tmpl new file mode 100644 index 00000000..2aad5d6d --- /dev/null +++ b/templates/index.md.tmpl @@ -0,0 +1,59 @@ +--- +page_title: "Provider: sonarqube" +description: |- + The sonarqube provider is used to configure sonarqube. The provider needs to be configured with a url, and either with user and password or token. +--- + +# Provider configuration + +The sonarqube provider is used to configure sonarqube. The provider needs to be configured with a url, and either with user and password or token. + +## Example: Authenticate with username and password + +```terraform +terraform { + required_providers { + sonarqube = { + source = "jdamata/sonarqube" + } + } +} + +provider "sonarqube" { + user = "admin" + pass = "admin" + host = "http://127.0.0.1:9000" +} +``` + +## Example: Authenticate with token + +```terraform +terraform { + required_providers { + sonarqube = { + source = "jdamata/sonarqube" + } + } +} + +provider "sonarqube" { + token = "d4at55a6f7r199bd707h39625685510880gbf7ff" + host = "http://127.0.0.1:9000" +} +``` + +## Argument Reference + +The following arguments are supported: + +- `user` - (Optional) Sonarqube user. This can also be set via the `SONARQUBE_USER` environment variable. +- `pass` - (Optional) Sonarqube pass. This can also be set via the `SONARQUBE_PASS` environment variable. +- `token` - (Optional) Sonarqube token. This can also be set via the `SONARQUBE_TOKEN` environment variable. +- `host` - (Required) Sonarqube url. This can be also be set via the `SONARQUBE_HOST` environment variable. +- `installed_version` - (Optional) The version of the Sonarqube server. When specified, the provider will avoid requesting this from the + server during the initialization process. This can be helpful when using the same Terraform code to install Sonarqube and configure it. +- `tls_insecure_skip_verify` - (Optional) Allows ignoring insecure certificates when set to true. Defaults to false. Disabling TLS verification + is dangerous and should only be done for local testing. +- `anonymize_user_on_delete` - (Optional) Allows anonymizing users on destroy. Requires Sonarqube version >= `9.7`. This can be helpful + to comply with regulations like [GDPR](https://en.wikipedia.org/wiki/General_Data_Protection_Regulation). diff --git a/templates/resources/new_code_periods.md.tmpl b/templates/resources/new_code_periods.md.tmpl new file mode 100644 index 00000000..e9021d56 --- /dev/null +++ b/templates/resources/new_code_periods.md.tmpl @@ -0,0 +1,20 @@ +--- +page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" +subcategory: "" +description: |- +{{ .Description | plainmarkdown | trimspace | prefixlines " " }} +--- + +# {{.Name}} ({{.Type}}) + +{{ .Description | trimspace }} + +## Example Usage + +### Example: Set the global new code period to a number of days +{{ tffile "examples/resources/sonarqube_new_code_periods/global.tf" }} + +### Example: create a project and set its new code period to a reference branch +{{ tffile "examples/resources/sonarqube_new_code_periods/project.tf" }} + +{{ .SchemaMarkdown | trimspace }} diff --git a/templates/resources/permissions.md.tmpl b/templates/resources/permissions.md.tmpl new file mode 100644 index 00000000..d1677fad --- /dev/null +++ b/templates/resources/permissions.md.tmpl @@ -0,0 +1,26 @@ +--- +page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" +subcategory: "" +description: |- +{{ .Description | plainmarkdown | trimspace | prefixlines " " }} +--- + +# {{.Name}} ({{.Type}}) + +{{ .Description | trimspace }} + +## Example Usage + +### Example: Set global admin permissions for a group called "my-admins" +{{ tffile "examples/resources/sonarqube_permissions/global-admin.tf" }} + +### Example: Set project admin permissions for a group called "my-project-admins" +{{ tffile "examples/resources/sonarqube_permissions/project-admin.tf" }} + +### Example: Set project admin permissions for a group called "my-project-admins on a permission template" +{{ tffile "examples/resources/sonarqube_permissions/project-template.tf" }} + +### Example: Set codeviewer & user permissions on project level for a user called "johndoe" +{{ tffile "examples/resources/sonarqube_permissions/project-user.tf" }} + +{{ .SchemaMarkdown | trimspace }} diff --git a/templates/resources/project.md.tmpl b/templates/resources/project.md.tmpl new file mode 100644 index 00000000..8378113d --- /dev/null +++ b/templates/resources/project.md.tmpl @@ -0,0 +1,20 @@ +--- +page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" +subcategory: "" +description: |- +{{ .Description | plainmarkdown | trimspace | prefixlines " " }} +--- + +# {{.Name}} ({{.Type}}) + +{{ .Description | trimspace }} + + +## Example Usage +### Example: create a project +{{ tffile "examples/resources/sonarqube_project/project.tf" }} + +### Example: a project with associated settings +{{ tffile "examples/resources/sonarqube_project/project-settings.tf" }} + +{{ .SchemaMarkdown | trimspace }} diff --git a/templates/resources/qualitygate.md.tmpl b/templates/resources/qualitygate.md.tmpl new file mode 100644 index 00000000..bc438349 --- /dev/null +++ b/templates/resources/qualitygate.md.tmpl @@ -0,0 +1,31 @@ +--- +page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" +subcategory: "" +description: |- +{{ .Description | plainmarkdown | trimspace | prefixlines " " }} +--- + +# {{.Name}} ({{.Type}}) + +{{ .Description | trimspace }} + + +## Example Usage + +{{ tffile "examples/resources/sonarqube_qualitygate/resource.tf" }} + +**Disclaimer: Operator Requirement for Grade Rating Conditions** + +When working with grade rating conditions, (A-D), it is important to note that the "GT" (greater than) operator must be used for the `op` field. This is due to SonarQube's API design. More information can be found in this [issue](https://github.com/jdamata/terraform-provider-sonarqube/issues/171). + +For example, if you are using a grade rating metric such as `new_reliability_rating`, where A represents the highest rating and subsequent letters represent lower ratings, you need to supply the `op` field with "GT" via the provider. Using "LT" will return an error from SonarQube's API: + +```terraform + condition { + metric = "new_reliability_rating" + op = "GT" + threshold = "1" + } +``` + +{{ .SchemaMarkdown | trimspace }} diff --git a/templates/resources/qualitygate_usergroup_association.md.tmpl b/templates/resources/qualitygate_usergroup_association.md.tmpl new file mode 100644 index 00000000..7a514734 --- /dev/null +++ b/templates/resources/qualitygate_usergroup_association.md.tmpl @@ -0,0 +1,19 @@ +--- +page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" +subcategory: "" +description: |- +{{ .Description | plainmarkdown | trimspace | prefixlines " " }} +--- + +# {{.Name}} ({{.Type}}) + +{{ .Description | trimspace }} + +## Example Usage +### Example: create a quality gate user association +{{ tffile "examples/resources/sonarqube_qualitygate_usergroup_association/user-association.tf" }} + +### Example: create a quality gate group association +{{ tffile "examples/resources/sonarqube_qualitygate_usergroup_association/usergroup-association.tf" }} + +{{ .SchemaMarkdown | trimspace }} diff --git a/templates/resources/setting.md.tmpl b/templates/resources/setting.md.tmpl new file mode 100644 index 00000000..02a18d37 --- /dev/null +++ b/templates/resources/setting.md.tmpl @@ -0,0 +1,19 @@ +--- +page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" +subcategory: "" +description: |- +{{ .Description | plainmarkdown | trimspace | prefixlines " " }} +--- + +# {{.Name}} ({{.Type}}) + +{{ .Description | trimspace }} + +## Example Usage +### Example: create a setting with multiple values +{{ tffile "examples/resources/sonarqube_setting/multi-value.tf" }} + +### Example: create a setting with multiple field values +{{ tffile "examples/resources/sonarqube_setting/multi-field-values.tf" }} + +{{ .SchemaMarkdown | trimspace }} diff --git a/templates/resources/user.md.tmpl b/templates/resources/user.md.tmpl new file mode 100644 index 00000000..f4495269 --- /dev/null +++ b/templates/resources/user.md.tmpl @@ -0,0 +1,19 @@ +--- +page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" +subcategory: "" +description: |- +{{ .Description | plainmarkdown | trimspace | prefixlines " " }} +--- + +# {{.Name}} ({{.Type}}) + +{{ .Description | trimspace }} + +## Example Usage +### Example: create a local user +{{ tffile "examples/resources/sonarqube_user/local.tf" }} + +### Example: create a remote user +{{ tffile "examples/resources/sonarqube_user/remote.tf" }} + +{{ .SchemaMarkdown | trimspace }} diff --git a/templates/resources/user_token.md.tmpl b/templates/resources/user_token.md.tmpl new file mode 100644 index 00000000..7fe89da5 --- /dev/null +++ b/templates/resources/user_token.md.tmpl @@ -0,0 +1,22 @@ +--- +page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" +subcategory: "" +description: |- +{{ .Description | plainmarkdown | trimspace | prefixlines " " }} +--- + +# {{.Name}} ({{.Type}}) + +{{ .Description | trimspace }} + +## Example Usage +### Example: create a user, user token and output the token value +{{ tffile "examples/resources/sonarqube_user_token/user-token.tf" }} + +### Example: create an expiring global analysis token and output the token value +{{ tffile "examples/resources/sonarqube_user_token/global-analysis-token.tf" }} + +### Example: create a project, project analysis token, and output the token value +{{ tffile "examples/resources/sonarqube_user_token/project-analysis-token.tf" }} + +{{ .SchemaMarkdown | trimspace }} diff --git a/templates/resources/webhook.md.tmpl b/templates/resources/webhook.md.tmpl new file mode 100644 index 00000000..f34aa968 --- /dev/null +++ b/templates/resources/webhook.md.tmpl @@ -0,0 +1,19 @@ +--- +page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" +subcategory: "" +description: |- +{{ .Description | plainmarkdown | trimspace | prefixlines " " }} +--- + +# {{.Name}} ({{.Type}}) + +{{ .Description | trimspace }} + +## Example Usage +### Example: create a webhook +{{ tffile "examples/resources/sonarqube_webhook/webhook.tf" }} + +### Example: create a webhook owned by a project +{{ tffile "examples/resources/sonarqube_webhook/project-webhook.tf" }} + +{{ .SchemaMarkdown | trimspace }} diff --git a/tools/go.mod b/tools/go.mod new file mode 100644 index 00000000..d26261ff --- /dev/null +++ b/tools/go.mod @@ -0,0 +1,51 @@ +module github.com/jdamata/terraform-provider-sonarqube/tools + +go 1.22.3 + +require ( + github.com/BurntSushi/toml v1.2.1 // indirect + github.com/Kunde21/markdownfmt/v3 v3.1.0 // indirect + github.com/Masterminds/goutils v1.1.1 // indirect + github.com/Masterminds/semver/v3 v3.2.0 // indirect + github.com/Masterminds/sprig/v3 v3.2.3 // indirect + github.com/ProtonMail/go-crypto v1.1.0-alpha.2 // indirect + github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect + github.com/armon/go-radix v1.0.0 // indirect + github.com/bgentry/speakeasy v0.1.0 // indirect + github.com/bmatcuk/doublestar/v4 v4.6.1 // indirect + github.com/cloudflare/circl v1.3.7 // indirect + github.com/fatih/color v1.16.0 // indirect + github.com/google/uuid v1.3.0 // indirect + github.com/hashicorp/cli v1.1.6 // indirect + github.com/hashicorp/errwrap v1.1.0 // indirect + github.com/hashicorp/go-checkpoint v0.5.0 // indirect + github.com/hashicorp/go-cleanhttp v0.5.2 // indirect + github.com/hashicorp/go-multierror v1.1.1 // indirect + github.com/hashicorp/go-uuid v1.0.3 // indirect + github.com/hashicorp/go-version v1.7.0 // indirect + github.com/hashicorp/hc-install v0.7.0 // indirect + github.com/hashicorp/terraform-exec v0.21.0 // indirect + github.com/hashicorp/terraform-json v0.22.1 // indirect + github.com/hashicorp/terraform-plugin-docs v0.19.4 // indirect + github.com/huandu/xstrings v1.3.3 // indirect + github.com/imdario/mergo v0.3.15 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/mattn/go-runewidth v0.0.9 // indirect + github.com/mitchellh/copystructure v1.2.0 // indirect + github.com/mitchellh/reflectwalk v1.0.2 // indirect + github.com/posener/complete v1.2.3 // indirect + github.com/shopspring/decimal v1.3.1 // indirect + github.com/spf13/cast v1.5.0 // indirect + github.com/yuin/goldmark v1.7.1 // indirect + github.com/yuin/goldmark-meta v1.1.0 // indirect + github.com/zclconf/go-cty v1.14.4 // indirect + go.abhg.dev/goldmark/frontmatter v0.2.0 // indirect + golang.org/x/crypto v0.21.0 // indirect + golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df // indirect + golang.org/x/mod v0.17.0 // indirect + golang.org/x/sys v0.18.0 // indirect + golang.org/x/text v0.15.0 // indirect + gopkg.in/yaml.v2 v2.3.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect +) diff --git a/tools/go.sum b/tools/go.sum new file mode 100644 index 00000000..49429cac --- /dev/null +++ b/tools/go.sum @@ -0,0 +1,140 @@ +github.com/BurntSushi/toml v1.2.1 h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak= +github.com/BurntSushi/toml v1.2.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= +github.com/Kunde21/markdownfmt/v3 v3.1.0 h1:KiZu9LKs+wFFBQKhrZJrFZwtLnCCWJahL+S+E/3VnM0= +github.com/Kunde21/markdownfmt/v3 v3.1.0/go.mod h1:tPXN1RTyOzJwhfHoon9wUr4HGYmWgVxSQN6VBJDkrVc= +github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= +github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= +github.com/Masterminds/semver/v3 v3.2.0 h1:3MEsd0SM6jqZojhjLWWeBY+Kcjy9i6MQAeY7YgDP83g= +github.com/Masterminds/semver/v3 v3.2.0/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= +github.com/Masterminds/sprig/v3 v3.2.3 h1:eL2fZNezLomi0uOLqjQoN6BfsDD+fyLtgbJMAj9n6YA= +github.com/Masterminds/sprig/v3 v3.2.3/go.mod h1:rXcFaZ2zZbLRJv/xSysmlgIM1u11eBaRMhvYXJNkGuM= +github.com/ProtonMail/go-crypto v1.1.0-alpha.2 h1:bkyFVUP+ROOARdgCiJzNQo2V2kiB97LyUpzH9P6Hrlg= +github.com/ProtonMail/go-crypto v1.1.0-alpha.2/go.mod h1:rA3QumHc/FZ8pAHreoekgiAbzpNsfQAosU5td4SnOrE= +github.com/apparentlymart/go-textseg/v15 v15.0.0 h1:uYvfpb3DyLSCGWnctWKGj857c6ew1u1fNQOlOtuGxQY= +github.com/apparentlymart/go-textseg/v15 v15.0.0/go.mod h1:K8XmNZdhEBkdlyDdvbmmsvpAG721bKi0joRfFdHIWJ4= +github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI= +github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= +github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/bmatcuk/doublestar/v4 v4.6.1 h1:FH9SifrbvJhnlQpztAx++wlkk70QBf0iBWDwNy7PA4I= +github.com/bmatcuk/doublestar/v4 v4.6.1/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc= +github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU= +github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= +github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= +github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/hashicorp/cli v1.1.6 h1:CMOV+/LJfL1tXCOKrgAX0uRKnzjj/mpmqNXloRSy2K8= +github.com/hashicorp/cli v1.1.6/go.mod h1:MPon5QYlgjjo0BSoAiN0ESeT5fRzDjVRp+uioJ0piz4= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= +github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-checkpoint v0.5.0 h1:MFYpPZCnQqQTE18jFwSII6eUQrD/oxMFp3mlgcqk5mU= +github.com/hashicorp/go-checkpoint v0.5.0/go.mod h1:7nfLNL10NsxqO4iWuW6tWW0HjZuDrwkBuEQsVcpCOgg= +github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= +github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= +github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= +github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= +github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= +github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY= +github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/hc-install v0.7.0 h1:Uu9edVqjKQxxuD28mR5TikkKDd/p55S8vzPC1659aBk= +github.com/hashicorp/hc-install v0.7.0/go.mod h1:ELmmzZlGnEcqoUMKUuykHaPCIR1sYLYX+KSggWSKZuA= +github.com/hashicorp/terraform-exec v0.21.0 h1:uNkLAe95ey5Uux6KJdua6+cv8asgILFVWkd/RG0D2XQ= +github.com/hashicorp/terraform-exec v0.21.0/go.mod h1:1PPeMYou+KDUSSeRE9szMZ/oHf4fYUmB923Wzbq1ICg= +github.com/hashicorp/terraform-json v0.22.1 h1:xft84GZR0QzjPVWs4lRUwvTcPnegqlyS7orfb5Ltvec= +github.com/hashicorp/terraform-json v0.22.1/go.mod h1:JbWSQCLFSXFFhg42T7l9iJwdGXBYV8fmmD6o/ML4p3A= +github.com/hashicorp/terraform-plugin-docs v0.19.4 h1:G3Bgo7J22OMtegIgn8Cd/CaSeyEljqjH3G39w28JK4c= +github.com/hashicorp/terraform-plugin-docs v0.19.4/go.mod h1:4pLASsatTmRynVzsjEhbXZ6s7xBlUw/2Kt0zfrq8HxA= +github.com/huandu/xstrings v1.3.3 h1:/Gcsuc1x8JVbJ9/rlye4xZnVAbEkGauT8lbebqcQws4= +github.com/huandu/xstrings v1.3.3/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= +github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= +github.com/imdario/mergo v0.3.15 h1:M8XP7IuFNsqUx6VPK2P9OSmsYsI/YFaGil0uD21V3dM= +github.com/imdario/mergo v0.3.15/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= +github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= +github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= +github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= +github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= +github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= +github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/posener/complete v1.2.3 h1:NP0eAhjcjImqslEwo/1hq7gpajME0fTLTezBKDqfXqo= +github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= +github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= +github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8= +github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= +github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= +github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +github.com/yuin/goldmark v1.7.1 h1:3bajkSilaCbjdKVsKdZjZCLBNPL9pYzrCakKaf4U49U= +github.com/yuin/goldmark v1.7.1/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E= +github.com/yuin/goldmark-meta v1.1.0 h1:pWw+JLHGZe8Rk0EGsMVssiNb/AaPMHfSRszZeUeiOUc= +github.com/yuin/goldmark-meta v1.1.0/go.mod h1:U4spWENafuA7Zyg+Lj5RqK/MF+ovMYtBvXi1lBb2VP0= +github.com/zclconf/go-cty v1.14.4 h1:uXXczd9QDGsgu0i/QFR/hzI5NYCHLf6NQw/atrbnhq8= +github.com/zclconf/go-cty v1.14.4/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= +go.abhg.dev/goldmark/frontmatter v0.2.0 h1:P8kPG0YkL12+aYk2yU3xHv4tcXzeVnN+gU0tJ5JnxRw= +go.abhg.dev/goldmark/frontmatter v0.2.0/go.mod h1:XqrEkZuM57djk7zrlRUB02x8I5J0px76YjkOzhB4YlU= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= +golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= +golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= +golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df h1:UA2aFVmmsIlefxMk29Dp2juaUSth8Pyn3Tq5Y5mJGME= +golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= +golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= +golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=