Signed-off-by: kiara <email@example.com> Reviewed-on: #3
|4 months ago|
|.gitignore||1 year ago|
|.gitlab-ci.yml||2 years ago|
|.terraform.lock.hcl||1 year ago|
|.woodpecker.yml||4 months ago|
|README.md||1 year ago|
|install_precommit_hook.sh||2 years ago|
|lint.sh||2 years ago|
|main.tf||1 year ago|
|outputs.tf||1 year ago|
|precommit.sh||2 years ago|
|variables.tf||2 years ago|
Contains Terraform code used to manage our infrastructure.
We want all our Terraform code to be well formatted and adhering to standards,
terraform fmt. Thus there is a pre-commit hook available to
validate this. Unfortunately this cannot be enforced remotely, so there is a
one time manual step needed.
Run the following command right after cloning the repository:
This will make sure you have the pre-commit hook installed so there is less of a chance you push something that doesn't match our standards.
As we're using GitLab's Terraform image for our CI/CD pipeline, we'll stick to using the latest version of Terraform. Instruction on how to install Terraform can be found here: https://www.terraform.io/downloads
Create a file
do_token = "<GREENHOST_API_KEY>"
... substituting in our actual key.
- go to https://gitlab.com/bij1/intranet/terraform/-/terraform
- open the triple dot menu for
Copy Terraform init command
- substitute in a personal access token in the shown command
- run the command locally to access the shared state
- Create a variable in
sensitive = true, to prevent it from appearing in the build output.
- Add the desired variable to the Environment Variables.
We may want to look at something like git-crypt or a central password store.