Skip to content

Adds Terraform.latest.gitlab-ci.yml CI template

What does this MR do?

Will deal with #223131 (closed) by creating a template that provides simpler and flexible configuration to the user. Another MR will follow to update Infrastructure as code with the Terraform and GitLab documentation so the user can benefit from a much easier configuration template.

As described in the issue, this new template will allow the user to seamlessly implement a Simple Terraform Pipeline as well as a concise Terraform Pipeline with multiple envs

Breaking changes and how to deal with them

NOTE 1: The Terraform.gitlab-ci.yml is not documented to be used with an include.template. Rather, it's only available from the list of templates when adding a new file. When the template is applied its body gets rendered in the file instead of referenced by an include.template. Therefore, breaking changes are very unlikely.

NOTE 2: Considering NOTE 1 we intend to open up a follow-up issue to discuss if perhaps we could convert the Terraform.latest.gitlab-ci.yml into an include.template.

NOTE 3: These are less of a breaking changes and more of informative support notes.

Terraform init

terraform init is now terraform init -reconfigure, which is actually a fix. So the current template is actually broken in regards to the GitLab HTTP backend.

Terraform image

The source of the image is changing from

registry.gitlab.com/gitlab-org/gitlab-build-images:terraform

to

registry.gitlab.com/gitlab-org/terraform-images/stable:latest

This might mean that you might have to wait a bit for the latter image to be updated if the former is ahead.

Job Stages

Be aware that the set of stages available on the previous template changed a bit. So if you're customizing these stages for any reason, perhaps you might need to rename them.

  • init was introduced as a new stage.
  • test was unused and now it's not present anymore.

Screenshots

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by João Alexandre Cunha

Merge request reports