Create a workflow that runs Terraform formatting and validation checks automatically in CI.
Understand how infrastructure code can be checked before apply in a team workflow.
Use a Terraform project suitable for validation in CI.
Add or reuse Terraform files
Make sure project is syntactically valid locally
Commit the baseline project
Add CI steps for fmt and validate.
Create workflow file
Add checkout step
Set up Terraform runtime
Run terraform fmt -check
Run terraform validate
Push changes and verify the CI checks behave as expected.
Push a commit
Check GitHub Actions results
Review logs and any failures
Document why validation belongs in CI
Create or use a Terraform repository.
Add a GitHub Actions workflow.
Run terraform fmt -check.
Run terraform validate.
Inspect the CI results.
Workflow runs automatically
Terraform formatting check executes
Terraform validation executes successfully
README explains the purpose of IaC validation in CI
Terraform validation workflow
Terraform sample project
README with CI and IaC explanation
Strong example of treating infrastructure as code with the same quality gates as application code.
Using validate without preparing project correctly
Forgetting Terraform setup step in CI
Breaking YAML formatting
Skipping local validation before pushing
Add terraform plan in CI for safe environments
Comment plan output on pull request
Use remote state discussion in docs
Add security scanning for Terraform code