Skip to content

Facets-cloud/tf-state-pusher-releases

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 

Repository files navigation

tf-state-pusher Releases

Public releases for the tf-state-pusher CLI tool.

Overview

tf-state-pusher is a CLI tool for safely pushing Terraform/OpenTofu state changes in concurrent environments without prolonged locking.

Problem: In monolithic Terraform repositories with targeted module releases, traditional state locking forces sequential execution.

Solution: This tool minimizes lock duration from "entire terraform apply" to "state validation + merge + push" (~2-5 seconds).

Installation

Download the latest release for your platform:

Linux

# AMD64
curl -L -o tf-state-pusher https://github.com/Facets-cloud/tf-state-pusher-releases/releases/latest/download/tf-state-pusher-linux-amd64
chmod +x tf-state-pusher
sudo mv tf-state-pusher /usr/local/bin/

# ARM64
curl -L -o tf-state-pusher https://github.com/Facets-cloud/tf-state-pusher-releases/releases/latest/download/tf-state-pusher-linux-arm64
chmod +x tf-state-pusher
sudo mv tf-state-pusher /usr/local/bin/

macOS

# Intel
curl -L -o tf-state-pusher https://github.com/Facets-cloud/tf-state-pusher-releases/releases/latest/download/tf-state-pusher-darwin-amd64
chmod +x tf-state-pusher
sudo mv tf-state-pusher /usr/local/bin/

# Apple Silicon
curl -L -o tf-state-pusher https://github.com/Facets-cloud/tf-state-pusher-releases/releases/latest/download/tf-state-pusher-darwin-arm64
chmod +x tf-state-pusher
sudo mv tf-state-pusher /usr/local/bin/

Usage

# Basic usage - push state for specific modules
tf-state-pusher -module module.level2.module.mysql_mydb -local-state ./downloaded-terraform.tfstate

# Multiple modules
tf-state-pusher \
  -module module.level2.module.mysql_mydb \
  -module module.level2.module.redis_cache \
  -local-state ./downloaded-terraform.tfstate

# View help
tf-state-pusher --help

How It Works

  1. Local Apply: Run Terraform with local state and no lock
  2. Acquire Lock: Lock only for the push operation (~2-5 seconds)
  3. Validate Serial: Check serial number continuity
  4. Merge if Needed: If remote state advanced, merge module-specific changes
  5. Push & Release: Push merged state and release lock immediately

Requirements

  • S3 backend with DynamoDB locking (standard Terraform backend)
  • AWS credentials configured
  • Terraform/OpenTofu initialized in the working directory

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors