Skip to content

v1.0.2

Choose a tag to compare

@andreimerlescu andreimerlescu released this 22 Jul 15:30
d995d92

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 --json flag 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 like jq for automation workflows.
    • Always-On File-Based JSON Report: Regardless of whether the --json flag 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.
  • Enhanced State File Backup Integrity Reporting:
    • The new_checksum field 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 no terraform import or state rm commands were executed.
    • The new.<env>.tfstate backup file is now always created in the backup directory, mirroring the final state after reconciliation, regardless of whether changes occurred.
  • Accurate State File Source Reporting: The state field in the JSON output now correctly reflects the original source URI of the Terraform state file (e.g., s3://bucket/key or /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 named original.<env>.tfstate and new.<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-dir flag (defaulting to ./backups) and automatically generates SHA256 checksums for both original and modified state files. Supports structured S3 backups for --s3-state configurations.
  • 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 suggested terraform import and terraform state rm commands.

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-execute

Known 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.