Speed up app delivery with automated cancellation of plan-only Terraform runs
Automatic cancellation of plan-only runs allows customers to easily cancel any unfinished runs for outdated commits to speed up application delivery.
Today, we’re excited to announce the general availability of a new feature that automatically cancels plan-only Terraform runs triggered by pull requests in version control systems (VCS) for HCP Terraform and Terraform Enterprise. This enhancement helps customers avoid the backlog of multiple runs caused by new commits pushed to a branch, ultimately speeding up the application delivery process.
When integrated with a VCS, HCP Terraform can automatically initiate a Terraform run to perform a plan operation whenever a pull request (PR) is created in the repository. However, when team members push new commits to the same branch, it can lead to a queue of Terraform runs, causing delays and inefficiencies. With the automatic cancellation of plan-only runs, you can now easily cancel any unfinished runs for outdated commits by selecting the option in your organization’s settings.
This blog will show you how to set up this feature and see it in action.
» Managing organization speculative plan settings
To view and manage an organization’s speculative plan settings, click Settings, followed by General under Version Control, then view the Manage speculative plans part of the page.
Once the organization setting is enabled, HCP Terraform will cancel ongoing or pending speculative plans if new commits are received on the same branch.
» Run details page
When a newer commit gets pushed to the same branch, users will see a message mentioning that the run was automatically canceled.
» Updated VCS status checks
For non-aggregated status checks, Terraform now shows a different message for auto-canceled plan that differs from the normally canceled one (which would show “Terraform plan canceled”).
For aggregated status checks, Terraform now includes a count of automatically canceled runs in the aggregated result, separating it from the count of manually canceled runs.
Also, in the aggregated status page, Terraform now includes a message saying that the run has been auto-canceled using the same message that it would send for non-aggregated status checks.
» Aggregated status page
When more than one run is automatically canceled for a commit, Terraform will display an alert in the “Resources to be changed” section as a reminder that the section may not reflect a complete result if all the runs of the commit were to reach completion. You can toggle “Hide automatically canceled plans” in the check box shown below:
» Getting started
These enhancements to HCP Terraform and Terraform Enterprise reflect our ongoing commitment to helping customers maximize their infrastructure investments and speed up application delivery by optimizing plan-only Terraform runs managed through the VCS workflow.
To learn more about these features, visit our page on automatically canceling plan-only runs. If you are new to Terraform, sign up for HCP Terraform and get started for free today.
Sign up for the latest HashiCorp news
More blog posts like this one
New Terraform integrations with Crowdstrike, Datadog, JFrog, Red Hat, and more
12 new Terraform integrations from 9 partners provide more options to automate and secure cloud infrastructure management.
Terraform delivers launch-day support for Amazon S3 Tables, EKS Hybrid Nodes, and more at re:Invent
The Terraform provider for AWS now enables users to manage a variety of new services just announced at re:Invent.
HashiCorp at re:Invent 2024: Infrastructure Lifecycle Management with AWS
A recap of HashiCorp infrastructure news and developments on AWS from the past year, from a new provider launch to simplifying infrastructure provisioning and more.