This project aims to provide a simple Terraform-related build feature for TeamCity. The key features are:
terraform show
Example of the report tab:
The plugin targets a scenario where terraform
is executed in a build chain; dependency build provides a plan file, and dependent build applies it. The build feature provided by plugin allows to control the changes introduced in plan file, review them easier and fail the plan build if necessary.
Synergises with Manual Approval feature introduced in 2022.04.
terraform plan -out <planfile>
terraform show -json <planfile> >> <output file>
if you plan to use the produced plan file later (e.g. to run terraform apply
), or
terraform show -json >> <output file>
during the build.
terraform show
in the build feature. Plan changes file: relative path to the JSON file containing terraform show
output.
Update build status: update the build status of the build with the output results (reports whether there are any planned changes, there are none, or if some of the resources will be removed/replaced).
Protected resource types: specify Java regular expression to match against resource types. Matching resource types are treated as protected, and if plugin detects that resource is planned for removal or replacement, it will raise a build problem.
Examples of usage:
my_db_type
: will match exactly this type of resourcemy_db_type|my_other_db_type
: will match both resources^((?!my_throwaway_type_of_resource).)*$
: will match anything except this resource type (whitelist)