To authenticate to the Terraform module registry, you need either:
- A [personal access token](../../../api/README.md#personalproject-access-tokens).
- A [personal access token](../../../api/README.md#personalproject-access-tokens) with at least `read_api` rights.
- A [CI/CD job token](../../../api/README.md#gitlab-cicd-job-token).
- A [deploy token](../../project/deploy_tokens/index.md).
## Publish a Terraform Module
...
...
@@ -78,9 +77,9 @@ Example response:
Prerequisites:
- You need to [authenticate with the API](../../../api/README.md#authentication). If authenticating with a deploy token, it must be configured with the `read_package_registry` and/or `write_package_registry` scope.
- You need to [authenticate with the API](../../../api/README.md#authentication). If authenticating with a personal access token, it must be configured with the `read_api` scope.
Authentication tokens (Deploy Token, Job Token, or Personal Access Token) can be provided for `terraform` in your `~/.terraformrc` file:
Authentication tokens (Job Token or Personal Access Token) can be provided for `terraform` in your `~/.terraformrc` file:
For examples of the Terraform module registry, check the projects below:
- The [_GitLab local file_ project](https://gitlab.com/mattkasa/gitlab-local-file) creates a minimal Terraform module and uploads it into the Terraform module registry using GitLab CI/CD.
- The [_Terraform module test_ project](https://gitlab.com/mattkasa/terraform-module-test) uses the module from the previous example.