Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Reorganizing the features section of the docs #3640

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 20 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions docs/_docs/01_getting-started/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ nav_title: Documentation
nav_title_link: /docs/
---

## Terragrunt configuration file

Terragrunt configuration is defined in a `terragrunt.hcl` file. This uses the same HCL syntax as OpenTofu/Terraform itself.

Here’s an example:
Expand Down Expand Up @@ -47,7 +45,7 @@ Refer to the following pages for a complete reference of supported features in t

## Configuration parsing order

It is important to be aware of the terragrunt configuration parsing order when using features like [locals]({{site.baseurl}}/docs/features/locals/#locals) and [dependency outputs]({{site.baseurl}}/docs/features/execute-terraform-commands-on-multiple-units-at-once/#passing-outputs-between-units), where you can reference attributes of other blocks in the config in your `inputs`. For example, because `locals` are evaluated before `dependency` blocks, you can not bind outputs from `dependency` into `locals`. On the other hand, for the same reason, you can use `locals` in the `dependency` blocks.
It is important to be aware of the terragrunt configuration parsing order when using features like [locals]({{site.baseurl}}/docs/features/locals/#locals) and [dependency outputs]({{site.baseurl}}/docs/features/stacks#passing-outputs-between-units), where you can reference attributes of other blocks in the config in your `inputs`. For example, because `locals` are evaluated before `dependency` blocks, you can not bind outputs from `dependency` into `locals`. On the other hand, for the same reason, you can use `locals` in the `dependency` blocks.

Currently terragrunt parses the config in the following order:

Expand Down
14 changes: 6 additions & 8 deletions docs/_docs/01_getting-started/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,15 @@ nav_title: Documentation
nav_title_link: /docs/
---

## Install Terragrunt

### Download from releases page
## Download from releases page

1. Go to the [Releases Page](https://github.com/gruntwork-io/terragrunt/releases).
2. Downloading the binary for your operating system: e.g., if you're on a Mac, download `terragrunt_darwin_amd64`; if you're on Windows, download `terragrunt_windows_amd64.exe`, etc.
3. Rename the downloaded file to `terragrunt`.
4. Add execute permissions to the binary: e.g., On Linux and Mac: `chmod u+x terragrunt`.
5. Put the binary somewhere on your `PATH`: e.g., On Linux and Mac: `mv terragrunt /usr/local/bin/terragrunt`.

### Install via a package manager
## Install via a package manager

Note that all the different package managers are third party. The third party Terragrunt packages may not be updated with the latest version, but are often close. Please check your version against the latest available on the [Releases Page](https://github.com/gruntwork-io/terragrunt/releases).
If you want the latest version, the recommended installation option is to [download from the releases page](https://github.com/gruntwork-io/terragrunt/releases).
Expand All @@ -32,7 +30,7 @@ If you want the latest version, the recommended installation option is to [down

* **FreeBSD**: You can install Terragrunt on FreeBSD using [Pkg](https://www.freebsd.org/cgi/man.cgi?pkg(7)): `pkg install terragrunt`.

### Install via tool manager
## Install via tool manager

A best practice when using Terragrunt is to pin the version you are using to ensure that you, your colleagues and your CI/CD pipelines are all using the same version. This also allows you to easily upgrade to new versions and rollback to previous versions if needed.

Expand All @@ -47,7 +45,7 @@ Colleagues and CI/CD pipelines can then install the associated tool manager, and

Note that the tools Terragrunt integrates with, such as OpenTofu and Terraform, can also be managed by these tool managers, so you can also pin the versions of those tools in the same file.

### Building from source
## Building from source

If you'd like to build from source, you can use `go` to build Terragrunt yourself, and install it:

Expand All @@ -58,7 +56,7 @@ cd terragrunt
go install
```

### Enable tab completion
## Enable tab completion

If you use either Bash or Zsh, you can enable tab completion for Terragrunt commands. To enable autocomplete, first ensure that a config file exists for your chosen shell.

Expand All @@ -82,6 +80,6 @@ terragrunt --install-autocomplete

Once the autocomplete support is installed, you will need to restart your shell.

### Terragrunt GitHub Action
## Terragrunt GitHub Action

Terragrunt is also available as a GitHub Action. Instructions on how to use it can be found at [https://github.com/gruntwork-io/terragrunt-action](https://github.com/gruntwork-io/terragrunt-action).
2 changes: 0 additions & 2 deletions docs/_docs/01_getting-started/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ nav_title: Documentation
nav_title_link: /docs/
---

## Overview

The following is a simple overview of the main features in Terragrunt.

It includes configurations that are a bit more complex than the ones found in the [Quick Start](/docs/getting-started/overview), but don't panic!
Expand Down
14 changes: 7 additions & 7 deletions docs/_docs/01_getting-started/terminology.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,15 @@ Ways in which Terragrunt can perform executions are limited to features like [ho

These utilities are part of what makes Terragrunt so powerful, as they allow users to move infrastructure management complexity out of modules.

### Runner Queue
### Run Queue

The Runner Queue is the queue of all units that Terragrunt will do work on over one or more runs.
The Run Queue is the queue of all units that Terragrunt will do work on over one or more runs.

Certain commands like [run-all](/docs/reference/cli-options/#run-all) populate the Runner Queue with all units in a stack, while other commands like `plan` or `apply` will only populate the Runner Queue with the unit that the command was run in.
Certain commands like [run-all](/docs/reference/cli-options/#run-all) populate the Run Queue with all units in a stack, while other commands like `plan` or `apply` will only populate the Run Queue with the unit that the command was run in.

Certain flags like [--terragrunt-include-dir](/docs/reference/cli-options/#terragrunt-include-dir) can be used to adjust the Runner Queue to include additional units. Conversely, there are flags like [--terragrunt-exclude-dir](/docs/reference/cli-options/#terragrunt-exclude-dir) that can be used to adjust the Runner Queue to exclude units.
Certain flags like [--terragrunt-include-dir](/docs/reference/cli-options/#terragrunt-include-dir) can be used to adjust the Run Queue to include additional units. Conversely, there are flags like [--terragrunt-exclude-dir](/docs/reference/cli-options/#terragrunt-exclude-dir) that can be used to adjust the Run Queue to exclude units.

Terragrunt will always attempt to run until the Runner Queue is empty.
Terragrunt will always attempt to run until the Run Queue is empty.

### Runner Pool

Expand All @@ -160,11 +160,11 @@ Dependencies are important for resolving the DAG, and the DAG is one of the most
The term "include" is used in two different contexts in Terragrunt.

1. **Include in configuration**: This is when one configuration file is included as partial configuration in another configuration file. This is done using the [include block](/docs/reference/config-blocks-and-attributes#include) in Terragrunt configuration files.
2. **Include in the Runner Queue**: This is when a unit is included in the Runner Queue. There are multiple ways for a unit to be included in the Runner Queue.
2. **Include in the Run Queue**: This is when a unit is included in the Run Queue. There are multiple ways for a unit to be included in the Run Queue.

### Exclude

The term "exclude" is only used in the context of excluding units from the Runner Queue.
The term "exclude" is only used in the context of excluding units from the Run Queue.

### Variable

Expand Down
24 changes: 13 additions & 11 deletions docs/_docs/02_features/auto-init.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,32 @@ layout: collection-browser-doc
title: Auto-init
category: features
categories_url: features
excerpt: Auto-Init is a feature of Terragrunt that makes it so that terragrunt init does not need to be called explicitly before other terragrunt commands.
excerpt: Learn how Terragrunt makes it so that you don't have to explicitly call `init` when using it.
tags: ["CLI"]
order: 245
nav_title: Documentation
nav_title_link: /docs/
---
## Auto-Init

*Auto-Init* is a feature of Terragrunt that makes it so that `terragrunt init` does not need to be called explicitly before other terragrunt commands.

When Auto-Init is enabled (the default), terragrunt will automatically call [`terraform init`](https://www.terraform.io/docs/commands/init.html) during other commands (e.g. `terragrunt plan`) when terragrunt detects that:
When Auto-Init is enabled (the default), terragrunt will automatically call [`tofu init`](https://opentofu.org/docs/cli/commands/init/)/[`terraform init`](https://www.terraform.io/docs/commands/init.html) before other commands (e.g. `terragrunt plan`) when terragrunt detects that any of the following are true:

- `terraform init` has never been called, or
- `init` has never been called.
- `source` needs to be downloaded.
- The `.terragrunt-init-required` file is in the downloaded module directory (`.terragrunt-cache/aaa/bbb/modules/<module>`).
- The modules or remote state used by a module have changed since the previous call to `init`.

- `source` needs to be downloaded, or
As [mentioned]({{site.baseurl}}/docs/features/extra-arguments/#extra_arguments-for-init), `extra_arguments` can be configured to allow customization of the `terraform init` command.

- exists file `.terragrunt-init-required` in downloaded module directory(`.terragrunt-cache/aaa/bbb/modules/<module>`) or
Note that there might be cases where terragrunt does not properly detect that `terraform init` needs be called. In this case, OpenTofu/Terraform can fail. Running `terragrunt init` again in these circumstances can correct the issue.

- the modules or remote state used by the module have changed since the previous call to `terraform init`.
## Disabling Auto-Init

As [mentioned]({{site.baseurl}}/docs/features/keep-your-cli-flags-dry/#extra_arguments-for-init), `extra_arguments` can be configured to allow customization of the `terraform init` command.
In some cases, it might be desirable to disable Auto-Init.

Note that there might be cases where terragrunt does not properly detect that `terraform init` needs be called. In this case, terraform would fail. Running `terragrunt init` again corrects this situation.
For example, you might want to specify a different `-plugin-dir` option to `terraform init` (and don't want to have it set in `extra_arguments`).

For some use cases, it might be desirable to disable Auto-Init. For example, if each user wants to specify a different `-plugin-dir` option to `terraform init` (and therefore it cannot be put in `extra_arguments`). To disable Auto-Init, use the `--terragrunt-no-auto-init` command line option or set the `TERRAGRUNT_NO_AUTO_INIT` environment variable to `true`.
To disable Auto-Init, use the `--terragrunt-no-auto-init` command line option or set the `TERRAGRUNT_NO_AUTO_INIT` environment variable to `true`.

Disabling Auto-Init means that you *must* explicitly call `terragrunt init` prior to any other terragrunt commands for a particular configuration. If Auto-Init is disabled, and terragrunt detects that `terraform init` needs to be called, then terragrunt will fail.
Disabling Auto-Init means that you *must* explicitly call `terragrunt init` prior to any other Terragrunt commands for a particular configuration. If Auto-Init is disabled, and Terragrunt detects that `init` needs to be called, Terragrunt will throw an error.
57 changes: 0 additions & 57 deletions docs/_docs/02_features/auto-retry.md

This file was deleted.

143 changes: 0 additions & 143 deletions docs/_docs/02_features/aws-auth.md

This file was deleted.

Loading