JM
jmcvetta/tfc-cancel-pending
Script to cancel pending runs on a Terraform Cloud workspace
tfc-cancel-pending
Script to cancel pending runs on a Terraform Cloud workspace
Caution
Footgun Warning: This software has no safety bumpers. It is easy to shoot
yourself in the foot. Be careful!
Install
For development
# Install dependencies using uv
uv syncAs a package
# Install from current directory
pip install .
# Or with uv
uv pip install .After installation as a package, the tfc-cancel-pending command will be available system-wide.
Usage
Using Make (recommended)
# Cancel pending runs
make cancel <organization> <workspace>
# Dry run (see what would be cancelled without actually cancelling)
make cancel-dry-run <organization> <workspace>
# Show help
make helpDirect script usage
# Using the console command (recommended)
uv run tfc-cancel-pending <organization> <workspace> [--dry-run]
# Or run the script directly
uv run python tfc_cancel_pending.py <organization> <workspace> [--dry-run]
# Or make the script executable
chmod +x tfc_cancel_pending.py
./tfc_cancel_pending.py <organization> <workspace> [--dry-run]If you already have the Terraform CLI authorized with Terraform
Cloud, tfc-cancel-pending will automatically read your TFC API token from the
Terraform CLI's credentials file.
Otherwise, you must populate environment variable TFC_TOKEN with your
Terraform Cloud API token.
On this page
Languages
Python74.0%Makefile26.0%
MIT License
Created March 15, 2023
Updated December 15, 2025