CircleCI Orb to lint and test and apply Terraform configuration. This Orb assumes tfenv is used at the target project.
For detail, please see https://circleci.com/orbs/registry/orb/suzuki-shunsuke/tfenv
https://circleci.com/orbs/registry/orb/suzuki-shunsuke/terraform
From version 0.3.0, some commands and jobs which don't depend on tfenv are replaced with suzuki-shunsuke/terraform.
https://github.com/suzuki-shunsuke/circleci-orb-terraform
https://github.com/suzuki-shunsuke/example-circleci-orb-tfenv
You can construct the following pipeline for Terraform.
- setup (checkout and install tools such as tfenv, tfnotify, and github-comment-cli)
- lint and test Terraform configuration
- apply the Terraform configuration
The following screenshot represents multiple Terraform configuration which are managed at a monorepo are tested in parallel.
https://circleci.com/workflow-run/c82b1a83-2db1-4b11-93c8-d8b6b0a58bef
When it is failed to run terraform fmt -check
or terraform validate
, the result is posted by github-comment-cli.
suzuki-shunsuke/example-circleci-orb-terraform#3 (comment)
suzuki-shunsuke/example-circleci-orb-terraform#3 (comment)
The results of terraform plan
and terraform apply
are posted by tfnotify. Ofcourse you can change the format of the comment by tfnotify's configuration.
suzuki-shunsuke/example-circleci-orb-terraform#1 (comment)