Skip to main content

Terragrunt Note

Terra grunt config file name, terragrunt.hcl

Blocks:

Terraform Block: to find terraform config files, communicate with resource on target provider โ€”โ€” Arguments: source, include_in_copy, extra_arguments, hooks before, error, after, init-from-module and init, terragrunt-read-config

Include block, inherit parent terraform configuration file to child config file, process data from parent to child in current config file Can only process one include block, path = find_in_parent_folders(โ€œregion.hclโ€)

Local blocks allows you to define alias within the configuration file

Remote_state block:

iam_role

Store remote state for multiple env

Generate
Path = โ€œs3-backend.tfโ€
If_exists = โ€œoverwrite_terragruntโ€
Contents = <<EOF
Terraform {
Backend โ€œs3โ€ {
Bucket = โ€œterraform-statefiles-aws-vpcโ€
Key = โ€œ${path_relative_to_include())/terraform.tfstateโ€

Call them in your terrgrunt file and use block name include

Include โ€œrootโ€ {
Path =
}

Comments