Commit 0c13bfff authored by Cédric OLIVIER's avatar Cédric OLIVIER Committed by Pierre Smeyers
Browse files

fix: remove .terraform.lock.hcl from cache

If you need to usage of .terraform.lock.hcl commit these file in git. see: https://developer.hashicorp.com/terraform/language/files/dependency-lock#dependency-installation-behavior
parent 71f4f27f
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -285,6 +285,12 @@ Be aware of the following:
* if the specified workspace doesn't exist, the template will create it,
* HTTP backend (default) doesn't support Workspaces. [See supported backends here](https://developer.hashicorp.com/terraform/language/state/workspaces#backends-supporting-multiple-workspaces).

### Terraform lock file

As explained in [Terraform documentation](https://developer.hashicorp.com/terraform/language/files/dependency-lock#lock-file-location), _you should include the `.terraform.lock.hcl` file in your version control repository_.

This will guarantee the Terraform template is using exactly the same dependencies version as you are using in your local development environment.

## Configuration reference

### Secrets management
+0 −1
Original line number Diff line number Diff line
@@ -677,7 +677,6 @@ stages:
    key: "$CI_COMMIT_REF_SLUG-terraform"
    paths:
      - $TF_PROJECT_DIR/.terraform/
      - $TF_PROJECT_DIR/.terraform.lock.hcl

# Create job prototype
# @arg ENV_PLAN_ENABLED : environment specific plan to apply (if transfered from upstream jobs)