github cloudposse/atmos v1.10.0

latest releases: v1.106.0, v1, v1.105.0...
2 years ago

what

  • Fix remote state for Terraform utils provider
  • Remove all global vars from Go code
  • Implement Logs.Verbose
  • Update terraform commands
  • Refactor

why

  • Remove all global vars from Go code - this fixes remote state for Terraform utils provider

    • Terraform executes a provider data source in a separate process and calls it using RPC
    • But this separate process is only one per provider, so if we call the code the get the remote state of two different components, the same process will be called
    • In the previous implementation, we used the global Go variable Config which was used by all functions to get the CLI configuration to use it in calculations of component and stack paths
    • When we tried to get the remote state of two different components from two diff repos with two diff atmos.yaml CLI config files, Terraform executed the two calls concurrently. The first call processed atmos.yaml and updated the Config global var with the component and stack paths. Then the second call also processed a different atmos.yaml (from another repo) and overrode the global Config var with values related to the second repo
    • One of the calls randomly failed with the error "Searched all paths, but could not find the component xxx in the stack yyy"
    • Removing all globals from the Go code (including the Config var) allows executing any part of the code concurrently without storing any state in global vars. The CLI config is now processed on all calls to the atmos code and is used as parameter to all Go functions that require it
  • Yes globals are bad (it was working before in almost all cases since we used only one atmos.yaml, or, if we used more than one from diff repos, the two atmos.yaml files were identically configured (base path, components path, stacks paths, included/excluded paths, etc.)
  • Implement Logs.Verbose - allow setting Logs.Verbose in atmos.yaml to enable/disable verbose logging (before, it was controlled only by the ATMOS_LOGS_VERBOSE ENV var)

  • Update terraform commands - delete the generated varfile from the component's folder after a successful terraform apply

Don't miss a new atmos release

NewReleases is sending notifications on new releases.