1.2.0
Improvements and new features Andriy Knysh (@aknysh) (#58)
what
- Improvements and new features
why
-
atmos terraform applymade 100% compatible withterraform apply:- does not run
terraform plan atmos terraform applydoes not useplanfile(by default)atmos terraform applywill ask for the confirmation to applyatmos terraform apply -auto-approvewill apply without asking for the confirmation to apply- The above behavior can be overridden. If
apply_auto_approveconfig (or ENV varATMOS_COMPONENTS_TERRAFORM_APPLY_AUTO_APPROVE) is set totrue,atmos terraform applywill not ask for the confirmation to apply regardless of whether the-auto-approveis specified or not
- does not run
-
atmos terraform deploy:- behaves like
atmos terraform apply -auto-approve - does not run
terraform plan - If
deploy_run_initconfig (or ENV varATMOS_COMPONENTS_TERRAFORM_DEPLOY_RUN_INIT, or--deploy-run-initcommand-line argument) is set totrue,atmos terraform deploywill first runterraform initto initialize modules. Otherwise, it will not runterraform init, andatmos terraform initwill 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-devatmos 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' - behaves like
-
Log level control:
-
If ENV var
ATMOS_LOGS_VERBOSEis set tofalse(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 commandATMOS_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
ttyis not attached orstdinis not attached) -
Use logical
contextto generate terraform workspaces and file names forplanfileandvarfile:- Instead of using the physical paths derived from the provided stack names to generate terraform workspaces and the names of
planfileandvarfile(which the old variant-basedatmosdid as well), find the logicalcontextfor the specified component in the specified stack (from the deep-merged vars). The logicalcontextconsist oftenant(if used),environmentandstage, and is controlled by thename_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
stacksparent 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
importpaths, but all CLI commands will continue working without making any changes to terraform state
- 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
- Instead of using the physical paths derived from the provided stack names to generate terraform workspaces and the names of