Typically, Terraform executes the following command with the location of the *.tf(main.tf) file as the current directory:
terraform apply --auto-approve
Is it possible to use Terraform from a location other than the current directory, for example, when using more than one Terraform from Shell?
cd hoge_folder
terraform apply --auto-approve
cd../fuga_folder
terraform apply --auto-approve
It will be
terraform apply --working_folder=hoge_folder
Would it be possible to do something like that?
terraform
Looking at the documentation, there seems to be an option called -chdir
.
If your workflow releases on overriding the root module directory, use the -chdir
global option install, which works across all commands and makes Terraform consistent directory for the living directory in the current working directory.
© 2024 OneMinuteCode. All rights reserved.