You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
kiara cda93dc555 ci: steps (#3)
Signed-off-by: kiara <kiara@bij1.org>
Reviewed-on: #3
4 months ago
.gitignore add why not store state in git 1 year ago
.gitlab-ci.yml Fix GitLab CI 2 years ago
.terraform.lock.hcl commit lock file 1 year ago
.woodpecker.yml ci: steps (#3) 4 months ago
README.md document api key usage 1 year ago
install_precommit_hook.sh Initial configuration 2 years ago
lint.sh Initial configuration 2 years ago
main.tf test api coverage 1 year ago
outputs.tf test api coverage 1 year ago
precommit.sh Initial configuration 2 years ago
variables.tf Initial configuration 2 years ago

README.md

terraform

Contains Terraform code used to manage our infrastructure.

Prerequisites

Pre-commit hook

We want all our Terraform code to be well formatted and adhering to standards, enforced by 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:

./install_precommit_hook.sh

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.

Terraform

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

Authentication

Create a file terraform.tfvars containing:

do_token = "<GREENHOST_API_KEY>"

... substituting in our actual key.

Managed state

Code-styling

We try to adhere to the naming conventions and code-styling best practices defined at Terraform best practices.

Secrets

Two steps:

  1. Create a variable in variables.tf with sensitive = true, to prevent it from appearing in the build output.
  2. Add the desired variable to the Environment Variables.

We may want to look at something like git-crypt or a central password store.