This repository has been archived by the owner on Aug 18, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
LP Notes from rover 1 step through
Ben Coleman edited this page Jun 14, 2021
·
2 revisions
rover -lz /tf/caf/landingzones/caf_launchpad \
-launchpad \
-var-folder /tf/caf/starter/configuration/demo/level0/launchpad \
-parallelism 30 \
-level level0 \
-env contoso_demo \
-a plan
Initial set up
-
landingzone_name
= path to TF modules directory, i.e. landingzones -
TF_VAR_tf_name
= last part of path OR user specify with -tfstate flag -
caf_command
="launchpad" this enables LP / Launchpad mode -
tf_action
= what was passed to -a i.e. [ plan | apply | destroy ] -
TF_VAR_workspace
="tfstate"
- Call fn - verify_azure_session()
- runs
az account show
- runs
- Call fn - process_target_subscription()
- if -target_subscription flag passed then
az account set
to that subid -
target_subscription_name
&target_subscription_id
obtained fromaz account
command -
ARM_SUBSCRIPTION_ID
=target_subscription_id
-
TF_VAR_tfstate_subscription_id
same asARM_SUBSCRIPTION_ID
unless overriden with -tfstate_subscription_id flag - In LP mode if
TF_VAR_tfstate_subscription_id
!=ARM_SUBSCRIPTION_ID
then EXIT!
- if -target_subscription flag passed then
Gets terraform_version for reason?
Call fn verify_parameters()
- If in LP mode &&
landingzone_name
UNSET -> Display error and exit - Ensures
TF_VAR_tf_name
andTF_VAR_tf_plan
are set AGAIN to last segment oflandingzone_name
with .tfstate and .tfplan appended.
Call fn deploy() -> pass in TF_VAR_workspace
Call fn get_storage_id()
- Try to find a storage acct in TF_VAR_tfstate_subscription_id WHERE tags match level and environment and set id
to it
remove local state and plan
check if destroy and no storage acct -> error
Call fn initialize_state()
- Check we are owner on subscription otherwise error and exit
- Remove sudo rm -f -- ${landingzone_name}/backend.azurerm.tf I DON@T KNOW WHY!
- remove any local state files
- set TF_VAR_tf_name and TF_VAR_tf_plan AGAIN!
- Call terraform init -upgrade=true
in the landingzone_name folder
- then calls plan/apply/destroy as per tf_action