v1.0.2
I am pleased to announce the release of reconcile-tfstate v1.0.2, a maintenance and enhancement release that further refines its output, improves data integrity reporting, and solidifies its robust backup mechanisms.
Building on the significant resource verification and backup capabilities introduced in v1.0.1, this release focuses on providing more comprehensive and versatile reporting for improved automation and auditing.
Key Features & Improvements in v1.0.2:
- Comprehensive Backup Data in JSON Format:
- Introduces a new
--jsonflag to render the entire reconciliation report (including configuration, results, and backup details) in a structured JSON format directly to standard output. This enables easy parsing with tools likejqfor automation workflows. - Always-On File-Based JSON Report: Regardless of whether the
--jsonflag is used for console output, a detailed JSON report (report.<env>.json) and its SHA256 checksum (report.<env>.json.sha256) are now always saved to the designated backup directory (--backups-dir). This ensures a complete, machine-readable audit trail for every run.
- Introduces a new
- Enhanced State File Backup Integrity Reporting:
- The
new_checksumfield in the JSON and Markdown reports is now guaranteed to be populated. It accurately reflects the SHA256 checksum of the post-reconciliation local state file (new.<env>.tfstate), ensuring complete integrity verification even when noterraform importorstate rmcommands were executed. - The
new.<env>.tfstatebackup file is now always created in the backup directory, mirroring the final state after reconciliation, regardless of whether changes occurred.
- The
- Accurate State File Source Reporting: The
statefield in the JSON output now correctly reflects the original source URI of the Terraform state file (e.g.,s3://bucket/keyor/path/to/local.tfstate), providing precise context for state provenance in the report. - Improved Backup File Naming Consistency: Resolved an issue where backup state files might be saved with redundant extensions (e.g.,
.tfstate.tfstate). Backup state files are now consistently namedoriginal.<env>.tfstateandnew.<env>.tfstate. - Minor Code Refinements: Addressed minor unused parameter warnings and internal logic streamlining for improved code quality and maintainability.
Key Features & Improvements (from v1.0.1, still relevant):
- Expanded Resource Verification Coverage: Dramatically increased the number of AWS resource types fully analyzed and verified against live infrastructure. This includes comprehensive checks for EC2, Auto Scaling, CloudWatch, IAM, Lambda, CloudFront, S3 configurations, and ECS.
- Automated State File Backups with History and Integrity Checks: Introduces the
--backups-dirflag (defaulting to./backups) and automatically generates SHA256 checksums for both original and modified state files. Supports structured S3 backups for--s3-stateconfigurations. - Improved Reporting: The full reconciliation report, including hashes and change details, is saved to a Markdown file within the backup directory.
- Clearer Console Output: Streamlined the console output for better readability.
- Automated Remediation (
--should-execute): Capability to automatically execute suggestedterraform importandterraform state rmcommands.
How to Use (New --json flag):
# Get JSON output to console, and save all reports to backups/
reconcile-tfstate --s3-state s3://your-bucket/path/to/dev.tfstate --region us-west-2 --json
# Analyze a local state file, execute changes, and save all reports to backups/
reconcile-tfstate --state dev.tfstate --region us-west-2 --should-executeKnown Limitations / Future Enhancements:
- This tool still only supports Terraform state file format version 4.
This v1.0.2 release further enhances reconcile-tfstate's utility, auditability, and ease of integration into automated pipelines.