Skip to content

print

Usage

Outputs a JSON object with contextual information such as the configuration file path, current working directory, cache download location, IAM role (if any), the binary used to run OpenTofu/Terraform, and the command being executed.

Examples

Print out information about the current context of Terragrunt.

Terminal window
$ terragrunt info print
{
"config_path": "/example/path/terragrunt.hcl",
"download_dir": "/example/path/.terragrunt-cache",
"iam_role": "",
"terraform_binary": "tofu",
"terraform_command": "print",
"working_dir": "/example/path"
}

With --all, each unit is written on one line, so the output is JSON Lines and a reader can take it a line at a time. Each unit reports the context run --all gives it, including the download_dir it caches into:

Terminal window
terragrunt info print --all | jq -c '{config_path, download_dir}'

Flags

--alloptional(bool)

Print the context of every unit discovered from the current working directory.

Print the context of every unit discovered from the current working directory, one JSON document per line.

Terminal window
terragrunt info print --all

Aliases:

  • a

Environment Variables:

  • TG_ALL
--filteroptional(list(string))

Print the context of only the units that match a filter query

Print the context of only the units that match the filter query. Passing --filter turns on --all.

Terminal window
terragrunt info print --filter './prod/**'

Environment Variables:

  • TG_FILTER
--filter-affectedoptional(bool)

Print the context of only the units affected by changes between the default branch and HEAD

Print the context of only the units modified, added, or removed between the default branch and HEAD. Equivalent to --filter '[main...HEAD]', with your repository’s default branch in place of main. Combine it with --all.

Terminal window
terragrunt info print --all --filter-affected

See Git-based filtering for how units are compared.

Environment Variables:

  • TG_FILTER_AFFECTED
--discovery-boundaryoptional(string)

Directory that encloses graph discovery for filters, instead of the git repository root

Replace the git repository root as the outer limit for filter expressions that traverse the dependency graph. info print does not print a unit that traversal reaches outside the boundary.

Terminal window
terragrunt info print --filter '...vpc' --discovery-boundary environments/staging

See --discovery-boundary for how the boundary applies.

Environment Variables:

  • TG_DISCOVERY_BOUNDARY