Terraform Project Template - Infrastructure¶
[[TOC]]
- Create a new Gitlab Project
- Follow steps in Playbook
- Copy files from this template to the new project
- DON'T COPY the
.gitmodulesfile nor theterraform-backend/folder - In
.gitlab-ci.ymlfile, replace theWORKSPACEvariable by the name of the new project (this name will be used by terraform to store the last status, you should not change this variable in future) - Files with status:
- In
.gitlab-ci.ymlfile, update variables that you need to inject to terraform (TF_VAR_) - Add the
terraform-backend/submodule (check Playbook, but should begit submodule add -b "main" ../terraform-backend.git) - Update submodules with:
git submodule update --init && git submodule update --remote - Update the file
.terraform-versionwith last version of terraform, (check here: https://github.com/hashicorp/terraform/blob/v1.1.9/CHANGELOG.md) - Update
providers.tf - Uncomment providers that you need in block
required_providersinsideproviders.tf - Uncomment providers that you need in blocks
providerinsideproviders.tf - Update
variables.tf(Uncomment variables that you need) - Ok, the base is ready, now add the new files
*.tffor your project
With ❤️ from Primetag - Engineering Team