BeerUP – 2023. október 11.

Terraform & GitLab CI

Gábor AUTH (gabor.auth@iotguru.cloud)

Agenda

1. Terraform

2. GitLab CI

3. Integrate

4. Summary, Q&A

1. Terraform

"Terraform is an infrastructure as code tool that enables you to safely and predictably provision and manage infrastructure in any cloud."

1. Terraform

  1. Infrastructure as code.
  2. Multi-cloud provisioning.
  3. Manage Kubernetes.
  4. Manage network infrastructure.
  5. Manage virtual images.
  6. Integrate with existing workflows.
  7. Enforce policy as code.

1. Terraform

Terraform main example

1. Terraform

Terraform provider example

1. Terraform

Terraform variables example

2. GitLab CI

"It aims to provide build automation, test automation, pipeline config management, artifact storage, and pipeline security."

2. GitLab CI

A Runner is an application that runs jobs in a pipeline.

It's simple, everything is in the .gitlab-ci.yaml

...or templates, or includes, or... nowadays, it's complicated.

2. GitLab CI

Scripts you want to run.

Configuration files.

Templates you want to include.

Dependencies and caches.

Sequence and parallel runs.

Automate, trigger or run manually.

3. Integrate

GitLab + Terraform

3. Integrate

GitLab CI 1

3. Integrate

GitLab CI 2

3. Integrate

GitLab pipeline

3. Integrate

GitLab pipeline deploy

3. Integrate

GitLab env vars

3. Integrate

GitLab terraform state

6. Summary, Q&A

GitLab pipeline build

6. Summary, Q&A

GitLab pipeline deploy

6. Summary, Q&A

AWS EC2 GitOps