github cloudposse/atmos 1.2.0

latest releases: v1.88.1, v1, v1.88.0...
2 years ago
Improvements and new features @aknysh (#58)

what

  • Improvements and new features

why

  • atmos terraform apply made 100% compatible with terraform apply:

    • does not run terraform plan
    • atmos terraform apply does not use planfile (by default)
    • atmos terraform apply will ask for the confirmation to apply
    • atmos terraform apply -auto-approve will apply without asking for the confirmation to apply
    • The above behavior can be overridden. If apply_auto_approve config (or ENV var ATMOS_COMPONENTS_TERRAFORM_APPLY_AUTO_APPROVE ) is set to true, atmos terraform apply will not ask for the confirmation to apply regardless of whether the -auto-approve is specified or not
  • atmos terraform deploy:

    • behaves like atmos terraform apply -auto-approve
    • does not run terraform plan
    • If deploy_run_init config (or ENV var ATMOS_COMPONENTS_TERRAFORM_DEPLOY_RUN_INIT, or --deploy-run-init command-line argument) is set to true, atmos terraform deploy will first run terraform init to initialize modules. Otherwise, it will not run terraform init, and atmos terraform init will need to be run first at least once
    ATMOS_COMPONENTS_TERRAFORM_DEPLOY_RUN_INIT=false atmos terraform deploy top-level-component1 -s tenant1-ue2-dev
    ATMOS_COMPONENTS_TERRAFORM_DEPLOY_RUN_INIT=true atmos terraform deploy top-level-component1 -s tenant1-ue2-dev
    
    atmos terraform deploy top-level-component1 -s tenant1/ue2/dev --deploy-run-init=false
    
    Using command line argument '--deploy-run-init=false'
    
    ATMOS_COMPONENTS_TERRAFORM_DEPLOY_RUN_INIT=false atmos terraform deploy top-level-component1 -s tenant1/ue2/dev --deploy-run-init=true
    
    Found ENV var ATMOS_COMPONENTS_TERRAFORM_DEPLOY_RUN_INIT=false
    Using command line argument '--deploy-run-init=true'
    
  • Log level control:

    • If ENV var ATMOS_LOGS_VERBOSE is set to false (default), the CLI will not print all the information about the config, stacks and component (and how it searches them), but will just output the essential info for each command

      ATMOS_LOGS_VERBOSE=true atmos terraform deploy top-level-component1 -s tenant1-ue2-dev
      
  • Check if terraform commands require user interaction, but running in a scripted environment (where a tty is not attached or stdin is not attached)

  • Use logical context to generate terraform workspaces and file names for planfile and varfile:

    • Instead of using the physical paths derived from the provided stack names to generate terraform workspaces and the names of planfile and varfile (which the old variant-based atmos did as well), find the logical context for the specified component in the specified stack (from the deep-merged vars). The logical context consist of tenant (if used), environment and stage, and is controlled by the name_pattern: "{tenant}-{environment}-{stage}" CLI config
    • This makes it completely independent of the folder structure where the YAML stack config files are defined - don't use the physical structure, look at the logical structure
    • Bonus:
      • You will be able move around the top-level YAML config files (that are not imported into other stacks) to any folder at any level (under stacks parent folder) "on-the-fly" , or change the names of the folders, WITHOUT needing to change anything - terraform workspace remains the same, the CLI will find the context from the deep-merged vars, and it just works
      • You can also move around the YAML config files even if they are already imported into other stacks, you will just need to update the import paths, but all CLI commands will continue working without making any changes to terraform state

Don't miss a new atmos release

NewReleases is sending notifications on new releases.