Provide Terraform templates for CI/CD

Problem to solve

There are no ready made Terraform templates available within GitLab, this means that users would need to create there own or import from the competition. In order to simplify the process of pushing applications to the cloud, we can offer templates to work with

Intended users

Users who use Terraform

Further details

Microsoft is also strong with its approach to multicloud, providing ready-made Terraform templates for pushing applications to other public clouds; it makes those templates easy to find in its marketplace.

Proposal

Provide templates similar to GitHub https://github.com/terraform-providers/terraform-provider-template

https://medium.com/@timhberry/terraform-pipelines-in-gitlab-415b9d842596

  name: hashicorp/terraform:light
  entrypoint:
    - '/usr/bin/env'
    - 'PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'

before_script:
  - rm -rf .terraform
  - terraform --version
  - mkdir -p ./creds
  - echo $SERVICEACCOUNT | base64 -d > ./creds/serviceaccount.json
  - terraform init

stages:
  - validate
  - plan
  - apply

validate:
  stage: validate
  script:
    - terraform validate

plan:
  stage: plan
  script:
    - terraform plan -out "planfile"
  dependencies:
    - validate
  artifacts:
    paths:
      - planfile

apply:
  stage: apply
  script:
    - terraform apply -input=false "planfile"
  dependencies:
    - plan
  when: manual

Permissions and Security

Documentation

Testing

What does success look like, and how can we measure that?

What is the type of buyer?

Links / references

Edited by Orit Golowinski