@@ -293,10 +293,13 @@ You have to be aware that your Terraform code has to be able to cope with variou
In order to be able to implement some **genericity** in your code, you should use [Terraform variables](https://www.terraform.io/docs/language/values/variables.html)(in your Terraform files), and environment variables (in your hook scripts):
1. any [predefined GitLab CI variable](https://docs.gitlab.com/ee/ci/variables/#predefined-environment-variables) may be freedly used in your hook scripts or extra options variables (ex: `TF_EXTRA_OPTS: "-var project_name=$CI_PROJECT_NAME"`)
2. you may also use [custom GitLab variables](https://docs.gitlab.com/ee/ci/variables/#custom-cicd-variables) to pass values to your hook script or even directly as Terraform variables [using the right syntax](https://www.terraform.io/docs/cli/config/environment-variables.html#tf_var_name)
1. Use [`tfvars` files](https://www.terraform.io/language/values/variables#variable-definitions-tfvars-files) for non-secret configuration:
* default `terraform.tfvars[.json]` and `*.auto.tfvars[.json]` files are obviously supported by Terraform,
* the template also auto-detects any file named `$env.env.tfvars[.json]` (ex: `staging.env.tfvars` for staging environment) and uses it with all related `terraform` commands.
2. any [predefined GitLab CI variable](https://docs.gitlab.com/ee/ci/variables/#predefined-environment-variables) may be freedly used in your hook scripts or extra options variables (ex: `TF_EXTRA_OPTS: "-var project_name=$CI_PROJECT_NAME"`)
3. you may also use [custom GitLab variables](https://docs.gitlab.com/ee/ci/variables/#custom-cicd-variables) to pass values to your hook script or even directly as Terraform variables [using the right syntax](https://www.terraform.io/docs/cli/config/environment-variables.html#tf_var_name)
(ex: env variable `$TF_VAR_ssh_private_key_file` will be visible as `ssh_private_key_file` Terraform variable in your code)
3.**dynamic variables** provided by the template:
4.**dynamic variables** provided by the template:
*`environment_type`: the environment type (`review`, `integration`, `staging` or `production`)
*`environment_name` (set as `$CI_ENVIRONMENT_NAME`): the full environment name (ex: `review/fix-prometheus-configuration`, `integration`, `staging` or `production`)
*`environment_slug` (set as `$CI_ENVIRONMENT_SLUG`): the _slugified_ environment name (ex: `review-fix-promet-r13zmu`, `integration`, `staging` or `production`)