So what happens when you run terragrunt plan/apply
in a deployment directory
e.g. dev/vpc
?
The below will walk you thorough the steps, and link to relevant files in a folder (vpc) where I've manually carried out the steps, so you can see what the end result looks like.
- In a staging directory (
.terragrunt-cache
) terragrunt pulls down the module source either from git or a relative path. In this example you can see it's just git cloned: https://github.com/terraform-aws-modules/terraform-aws-vpc - Creates a backend.tf based on your remote state config defined in your root terragrunt.hcl, and figures out the relative path and uses that as the key for your state file
- Creates a provider.tf based on your provider config in your root terragrunt.hcl
- Creates a terraform.tfvars based on all the values declared in your root terragrunt.hcl, env.hcl, and "inputs" specified in the terragrunt.hcl deployment file
- Runs
terraform init
for you - Runs
terraform plan/apply
(or whatever other terragrunt command you invoked e.g.terragrunt destroy
)