github cloudposse/atmos v1.166.0-rc.7

latest releases: v1.167.0, v1, v1.166.1-rc.0...
pre-release4 days ago
Add CLI flags to `atmos terraform` commands to control processing the templates and YAML functions in Atmos stack manifests @aknysh (#1157) ## what
  • Add CLI flags to atmos terraform commands to control processing (enable/disable) the templates and YAML functions in Atmos stack manifests
  • Add unit tests
  • Update docs

why

Flag Description Alias Required
--process-templates Enable/disable Go template processing in Atmos stack manifests
when executing terraform commands.
atmos terraform plan <component> -s <stack> --process-templates=false.
If the flag is not passed,
template procesing is enabled by default.
no
--process-functions Enable/disable YAML functions processing in Atmos stack manifests
when executing terraform commands.
atmos terraform apply <component> -s <stack> --process-functions=false
If the flag is not passed,
functions procesing is enabled by default.
no
--skip Skip processing a specific Atmos YAML function
in Atmos stacks manifests when executing terraform commands.
To specify more than one function,
use multiple --skip flags, or separate the functions with a comma:
atmos terraform plan <component> -s <stack> --skip=eval --skip=include
atmos terraform apply <component> -s <stack> --skip=terraform.output,include
no

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Introduced new command-line options for enhanced control over Terraform executions, allowing users to enable/disable template and YAML function processing and skip specific functions.
    • Added new YAML configuration files for deployment settings and non-production environments.
  • Documentation

    • Updated help and usage guides for Terraform commands with clearer flag descriptions and improved instructions.
    • Restructured documentation format for various Terraform commands to enhance clarity and usability.
  • Chores

    • Upgraded Atmos tool versions in container builds and CI integrations.
    • Updated various dependency versions to enhance overall stability and performance.
add terraform plan-diff command @mcalhoun (#1144) ## what

Create a new command that shows what has changed between two plan files

why

Helps validate that an "approved plan" hasn't changed prior to deployment

example output

Diff Output
===========

Variables:
----------
~ location: Stockholm => New Jersey

Resources:
-----------

data.http.weather
  ~ id: https://wttr.in/Stockholm?0&format=&lang=se&u=m => https://wttr.in/New+Jersey?0&format=&lang=se&u=m
  ~ url: https://wttr.in/Stockholm?0&format=&lang=se&u=m => https://wttr.in/New+Jersey?0&format=&lang=se&u=m
  ~ response_body: Weather report: Stockholm

     \  /       Partly cloudy
   _ /"".-.     -1(-4) °C      
     \_(   ).   ↓ 8 km/h       
     /(___(__)  10 km          
                0.0 mm         
 => Weather report: New+Jersey

                Overcast
       .--.     +8(4) °C       
    .-(    ).   ↙ 22 km/h      
   (___.__)__)  16 km          
                0.0 mm         

  ~ response_headers: {
    ~ Content-Length: 350 => 304
    ~ Date: Thu, 13 Mar 2025 19:28:58 GMT => Thu, 13 Mar 2025 19:29:17 GMT
}
  ~ body: Weather report: Stockholm

     \  /       Partly cloudy
   _ /"".-.     -1(-4) °C      
     \_(   ).   ↓ 8 km/h       
     /(___(__)  10 km          
                0.0 mm         
 => Weather report: New+Jersey

                Overcast
       .--.     +8(4) °C       
    .-(    ).   ↙ 22 km/h      
   (___.__)__)  16 km          
                0.0 mm         

local_file.cache
  ~ content: Weather report: Stockholm

     \  /       Partly cloudy
   _ /"".-.     -1(-4) °C      
     \_(   ).   ↓ 8 km/h       
     /(___(__)  10 km          
                0.0 mm         
 => Weather report: New+Jersey

                Overcast
       .--.     +8(4) °C       
    .-(    ).   ↙ 22 km/h      
   (___.__)__)  16 km          
                0.0 mm         


Outputs:
--------
~ url: https://wttr.in/Stockholm?0&format=&lang=se&u=m => https://wttr.in/New+Jersey?0&format=&lang=se&u=m
~ weather: Weather report: Stockholm

     \  /       Partly cloudy
   _ /"".-.     -1(-4) °C      
     \_(   ).   ↓ 8 km/h       
     /(___(__)  10 km          
                0.0 mm         
 => Weather report: New+Jersey

                Overcast
       .--.     +8(4) °C       
    .-(    ).   ↙ 22 km/h      
   (___.__)__)  16 km          
                0.0 mm         

~ location: Stockholm => (sensitive value)

Windows-Specific Logic

This PR includes some error handling to deal with two distinct Windows-specific issues that caused intermittent test failures:

Process Termination & Goroutine Synchronization

Windows handles process termination differently than Unix systems. When intercepting os.Exit() calls in tests, Windows may not properly schedule the goroutine to completion, causing deadlocks when waiting for both exit codes and goroutine completion signals.

 // Handle Windows specially - just wait for exit code  
   if runtime.GOOS == "windows" {
       return <-exitCodeCh
   }

This specialized Windows path ensures we only wait for the exit code without expecting the goroutine to signal completion, avoiding deadlocks specific to Windows process termination behavior.

File System Timing Issues

Windows file systems sometimes experience timing inconsistencies where file handles aren't fully released or contents aren't completely flushed before subsequent operations start.

// Add a small delay to ensure Windows file operations are complete
   time.Sleep(500 * time.Millisecond)

This small delay before the on-the-fly plan-diff ensures previous Terraform operations fully complete their file I/O before starting the next test phase, preventing race conditions in file access.

These changes significantly improve test reliability on Windows environments while preserving the original test behavior on Unix platforms.

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Introduced a new “plan-diff” command that compares two Terraform plans, highlighting differences in variables, resources, and outputs.
    • Improved error reporting that now provides distinct exit statuses when plan differences are detected.
  • Documentation

    • Updated CLI help output and online guides to include detailed usage instructions, flag requirements, and examples for the new plan-diff functionality.

Don't miss a new atmos release

NewReleases is sending notifications on new releases.