Local state and plan files are always placed in ${TF_DATA_DIR}/tfstates/${TF_VAR_level}/${TF_VAR_workspace}/${TF_VAR_tf_name}
Note TF_VAR_workspace is set to "tfstate" unless the user passes --workspace to set it
Note the Rover devcontainer sets TF_DATA_DIR to $HOME/.terraform.cache
For normal landing zone deployments terraform init is called with -backend-config so it uses remote state. The storage account to use is found using the environment tags and the level
Launchpad deployment is a special case where state is created locally and then uploaded to blob, this takes a different path through the rover code
the -tfstate parameter to rover sets the state key that is used, i.e. the blob name
${TF_DATA_DIR}/tfstates/${TF_VAR_level}/${TF_VAR_workspace}/${TF_VAR_tf_name}
TF_VAR_workspace
is set to "tfstate" unless the user passes--workspace
to set itTF_DATA_DIR
to$HOME/.terraform.cache
terraform init
is called with-backend-config
so it uses remote state. The storage account to use is found using the environment tags and the level-tfstate
parameter to rover sets the state key that is used, i.e. the blob name