Creating your Pipeline with GitLab
GitLab CI
Push your code in a new project on Gitlab
Create a new project on GitLab and push your Terraform files on it. You can use either gitlab.com or your self hosted GitLab instance.
Protect your branch
The cluster creation pipeline is triggered only on protected branches, so you have to protect every branch that will define a cluster (in Settings ⇒ Repository ⇒ Protected Branches).
Add CI / CD variables
There are multiple ways to configure the {terraform-provider-link}[Terraform {terraform-provider} provider]. You could commit the credentials in your code, with a high potential risk of secret leakage, or another simple solution is to define the required environment variables as CI/CD variables.
In your project’s Setting → CI/CD → Variables, add variables for:
Unresolved directive in pipelines_gitlab.adoc - include::partial$variables-{ci-variables}.adoc[]