I need to work with terraform and terragrunt. There would be like 15 20 resources/services of AWS I need to deploy using IAC, while working on terragrunt what I found is if one of the layer needs to be applied, I need to go into that particular directory and run terragrunt plan/apply
.
I was thinking if there is possible way to do the terragrunt apply just by sitting on the root folder. My folder structure now:
Root folder: terraform/
/layers/
/iam-policies/main.tf
/sagemaker/main.tf
Then for terragrunt similarly as layers(tf) environments(terragrunt/hcl) is also in the terraform folder:
/environments/
/iam-policies/terragrunt.hcl
/sagemaker/terragrunt.hcl
Is there a way to apply iam-policies
or sagemaker
layer from the root folder i.e terraform
?
You can use the terragrunt-include-dir
flag for this.
terragrunt plan-all --terragrunt-include-dir "iam-policies" --terragrund-include-dir "sagemaker"
There are other CLI options that can be combined to achieve even finer selections in your directories.