Hi guys, so, this will be my last lab.
In the previous labs, I used Terraform from my local machine.
The workflow was simple:
local terminal -> terraform plan -> terraform apply
Enter fullscreen mode
Exit fullscreen mode
That worked for learning, but it is not how I want to manage infrastructure changes in a more professional setup.
For this lab, I wanted to move Terraform execution into GitHub Actions.
The target workflow is:
Pull Request -> terraform fmt -> terraform validate -> terraform plan Manual Approval -> terraform apply
Enter fullscreen mode
Exit fullscreen mode
The main goal is not only automation.
The main goal is infrastructure change control.
In this lab, I built a Terraform CI/CD workflow using:
GitHub Actions
Google Cloud Workload Identity Federation
Terraform remote state in Google Cloud Storage
terraform fmt -check
terraform validate
terraform plan
manual terraform apply
no downloaded service account JSON key
The key idea is:
Terraform should not only create…