Skip to content
Snippets Groups Projects
Commit 4f066612 authored by João Alexandre Cunha's avatar João Alexandre Cunha
Browse files

Merge branch 'opentofu-note-in-readme' into 'master'

Add OpenTofu note to README

See merge request https://gitlab.com/gitlab-org/terraform-images/-/merge_requests/254



Merged-by: default avatarJoão Alexandre Cunha <j.a.cunha@gmail.com>
Approved-by: default avatarJoão Alexandre Cunha <j.a.cunha@gmail.com>
Co-authored-by: default avatarTimo Furrer <tfurrer@gitlab.com>
parents ae1c08d2 c3c69f97
No related branches found
No related tags found
No related merge requests found
# Terraform Images # Terraform Images
This repository won't upgrade to any new Terraform releases with the BSL license for now. > 🚨 This repository won't upgrade to any new Terraform releases with the BSL license for now.
Please follow [this issue](https://gitlab.com/gitlab-org/terraform-images/-/issues/114) for updates. > Please follow [this issue](https://gitlab.com/gitlab-org/terraform-images/-/issues/114) for updates.
>
> We'd like to advise you to use the new [**OpenTofu CI/CD component**](https://gitlab.com/components/opentofu).
>
> Alternatively, you may build this project with the latest Terraform release yourself and
> host it in your own registry.
This repository provides a docker image which contains the `gitlab-terraform` shell script. This script is a thin wrapper around the `terraform` binary. Its main purpose is to serve the [Infrastructure as code with Terraform and GitLab This repository provides a docker image which contains the `gitlab-terraform` shell script. This script is a thin wrapper around the `terraform` binary. Its main purpose is to serve the [Infrastructure as code with Terraform and GitLab
](https://docs.gitlab.com/ee/user/infrastructure/), by extracting some of the standard configuration a user would need to set up to use the Terraform backend on GitLab as well as the Terraform merge request widget. ](https://docs.gitlab.com/ee/user/infrastructure/), by extracting some of the standard configuration a user would need to set up to use the Terraform backend on GitLab as well as the Terraform merge request widget.
...@@ -24,33 +30,33 @@ Should be the backend URL. For the GitLab backend it will be something like: ...@@ -24,33 +30,33 @@ Should be the backend URL. For the GitLab backend it will be something like:
### `TF_USERNAME` ### `TF_USERNAME`
Is your user login name, which must have maintainer access. If this is unset, it will default to the value of GITLAB_USER_LOGIN which is the username that triggered the build. Is your user login name, which must have maintainer access. If this is unset, it will default to the value of `GITLAB_USER_LOGIN` which is the username that triggered the build.
### `TF_PASSWORD` ### `TF_PASSWORD`
An access token created for the above maintainer with the api scope. If this is unset, it will default to the value of CI_JOB_TOKEN and override the TF_USERNAME to match. An access token created for the above maintainer with the `api` scope. If this is unset, it will default to the value of `CI_JOB_TOKEN` and override the `TF_USERNAME` to match.
## Support for Gitlab CI Environment Variables ## Support for GitLab CI Environment Variables
gitlab-terraform exposes the following Gitlab CI Environment Variables as TF_VAR inputs `gitlab-terraform` exposes the following GitLab CI Environment Variables as `TF_VAR` inputs
- CI_JOB_ID - `CI_JOB_ID`
- CI_COMMIT_SHA - `CI_COMMIT_SHA`
- TF_VAR_CI_JOB_STAGE - `TF_VAR_CI_JOB_STAGE`
- CI_PROJECT_ID - `CI_PROJECT_ID`
- CI_PROJECT_NAME - `CI_PROJECT_NAME`
- CI_PROJECT_NAMESPACE - `CI_PROJECT_NAMESPACE`
- CI_PROJECT_PATH - `CI_PROJECT_PATH`
- CI_PROJECT_URL - `CI_PROJECT_URL`
You can use these in your terraform files in the following way You can use these in your Terraform files in the following way
``` ```
variable "CI_PROJECT_NAME" { variable "CI_PROJECT_NAME" {
...@@ -72,9 +78,9 @@ If there's no other issue already discussing what you want, simply open a new is ...@@ -72,9 +78,9 @@ If there's no other issue already discussing what you want, simply open a new is
This project uses [Semantic Versioning](https://semver.org). We use commit This project uses [Semantic Versioning](https://semver.org). We use commit
messages to automatically determine the version bumps, so they should adhere to messages to automatically determine the version bumps, so they should adhere to
the conventions of [Conventional Commits (v1.0.0)](https://www.conventionalcommits.org/en/v1.0.0/). the conventions of [Conventional Commits `(v1.0.0)`](https://www.conventionalcommits.org/en/v1.0.0/).
# Release # Release
Currently we release three versions of this image to support the last three stable major versions of Terraform. Currently we release three versions of this image to support the last three stable major versions of Terraform.
The image versioning is documented [here](https://docs.gitlab.com/ee/user/infrastructure/iac/gitlab_terraform_helpers.html#terraform-images). The image versioning is documented [here](https://docs.gitlab.com/ee/user/infrastructure/iac/gitlab_terraform_helpers.html#terraform-images).
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment