Terragrunt code example for multiple target infra environments.
To provision all environments, just run command below on the root project directory:
terragrunt run-all init
terragrunt run-all plan
terragrunt run-all apply
Below are steps to provision infra-one
only.
To provision both dev
and prod
, can run command below:
cd infra-one/
terragrunt run-all init
terragrunt run-all plan
terragrunt run-all apply
To provision only dev
, can run command below:
cd infra-one/dev/
terragrunt init
terragrunt plan
terragrunt apply
To provision only prod
, can run command below:
cd infra-one/prod/
terragrunt init
terragrunt plan
terragrunt apply
Below are steps to provision infra-two
only.
To provision both dev
and prod
, can run command below:
cd infra-two/
terragrunt run-all init
terragrunt run-all plan
terragrunt run-all apply
To provision only dev
, can run command below:
cd infra-two/dev/
terragrunt init
terragrunt plan
terragrunt apply
To provision only prod
, can run command below:
cd infra-two/prod/
terragrunt init
terragrunt plan
terragrunt apply
Note: both infra-one
and infra-two
will produce the same infrastructure, they only use different code style