Skip to content

Commit

Permalink
fix: Deprecating legacy exclude and error configurations (#3625)
Browse files Browse the repository at this point in the history
* fix: Deprecating legacy exclude and error configurations

* fix: Cleaning up deprecating docs
  • Loading branch information
yhakbar authored Dec 6, 2024
1 parent 36fa169 commit fd2f8ea
Showing 1 changed file with 43 additions and 37 deletions.
80 changes: 43 additions & 37 deletions docs/_docs/04_reference/config-blocks-and-attributes.md
Original file line number Diff line number Diff line change
Expand Up @@ -350,13 +350,19 @@ The `remote_state` block supports the following arguments:

- `path`: The path where the generated file should be written. If a relative path, it'll be relative to the Terragrunt
working dir (where the OpenTofu/Terraform code lives).
- `if_exists` (attribute): What to do if a file already exists at `path`. Valid values are: `overwrite` (overwrite the
existing file), `overwrite_terragrunt` (overwrite the existing file if it was generated by terragrunt; otherwise,
error) `skip` (skip code generation and leave the existing file as-is), `error` (exit with an error).
- `if_exists` (attribute): What to do if a file already exists at `path`.

Valid values are:

- `overwrite` (overwrite the existing file)
- `overwrite_terragrunt` (overwrite the existing file if it was generated by terragrunt; otherwise, error)
- `skip` (skip code generation and leave the existing file as-is)
- `error` (exit with an error)

- `config` (attribute): An arbitrary map that is used to fill in the backend configuration in OpenTofu/Terraform. All the
properties will automatically be included in the OpenTofu/Terraform backend block (with a few exceptions: see below). For
example, if you had the following `remote_state` block:
properties will automatically be included in the OpenTofu/Terraform backend block (with a few exceptions: see below).

For example, if you had the following `remote_state` block:

```hcl
remote_state {
Expand Down Expand Up @@ -1108,10 +1114,19 @@ The `generate` block supports the following arguments:
name to differentiate between the other blocks.
- `path` (attribute): The path where the generated file should be written. If a relative path, it'll be relative to the
Terragrunt working dir (where the OpenTofu/Terraform code lives).
- `if_exists` (attribute): What to do if a file already exists at `path`. Valid values are: `overwrite` (overwrite the
existing file), `overwrite_terragrunt` (overwrite the existing file if it was generated by terragrunt; otherwise,
error) `skip` (skip code generation and leave the existing file as-is), `error` (exit with an error).
- `if_disabled` (attribute): What to do if a file already exists at `path` and `disable` is set to `true`. Valid values are: `remove` (remove the existing file), `remove_terragrunt` (remove the existing file if it was generated by terragrunt; otherwise, error) `skip` (skip removing and leave the existing file as-is). Defaults to `skip`. Optional.
- `if_exists` (attribute): What to do if a file already exists at `path`.

Valid values are:
- `overwrite` (overwrite the existing file)
- `overwrite_terragrunt` (overwrite the existing file if it was generated by terragrunt; otherwise, error)
- `skip` (skip code generation and leave the existing file as-is)
- `error` (exit with an error)
- `if_disabled` (attribute): What to do if a file already exists at `path` and `disable` is set to `true` (`skip` by default)

Valid values are:
- `remove` (remove the existing file)
- `remove_terragrunt` (remove the existing file if it was generated by terragrunt; otherwise, error)
- `skip` (skip removing and leave the existing file as-is).
- `comment_prefix` (attribute): A prefix that can be used to indicate comments in the generated file. This is used by
terragrunt to write out a signature for knowing which files were generated by terragrunt. Defaults to `#`. Optional.
- `disable_signature` (attribute): When `true`, disables including a signature in the generated file. This means that
Expand Down Expand Up @@ -1297,7 +1312,7 @@ Consider using this for units that are expensive to continuously update, and can
The `errors` block contains all the configurations for handling errors. Each configuration block, such as `retry` and `ignore`,
is nested within the `errors` block to define specific error-handling strategies.

Retry Configuration:
#### Retry Configuration

The `retry` block within the `errors` block defines rules for retrying operations when specific errors occur.
This is useful for handling intermittent errors that may resolve after a short delay or multiple attempts.
Expand All @@ -1323,7 +1338,7 @@ Parameters:
- `sleep_interval_sec`: Time (in seconds) to wait between retries.
- Example: `10` seconds.

Ignore Configuration:
#### Ignore Configuration

The `ignore` block within the `errors` block defines rules for ignoring specific errors. This is useful when certain
errors are known to be safe and should not halt operations.
Expand Down Expand Up @@ -1368,7 +1383,7 @@ If an error occurs and the author of the unit has signaled `safe_to_revert = tru

This approach ensures consistent and automated error handling in complex pipelines.

Combined Example:
#### Combined Example

Below is a combined example showcasing both retry and ignore configurations within the `errors` block.

Expand Down Expand Up @@ -1414,31 +1429,18 @@ Error handling follows a specific process:
## Attributes

- [Blocks](#blocks)
- [terraform](#terraform)
- [A note about using modules from the registry](#a-note-about-using-modules-from-the-registry)
- [remote\_state](#remote_state)
- [include](#include)
- [Single include](#single-include)
- [Multiple includes](#multiple-includes)
- [Limitations on accessing exposed config](#limitations-on-accessing-exposed-config)
- [locals](#locals)
- [dependency](#dependency)
- [dependencies](#dependencies)
- [generate](#generate)
- [Attributes](#attributes)
- [inputs](#inputs)
- [download\_dir](#download_dir)
- [prevent\_destroy](#prevent_destroy)
- [skip](#skip)
- [iam\_role](#iam_role)
- [iam\_assume\_role\_duration](#iam_assume_role_duration)
- [iam\_assume\_role\_session\_name](#iam_assume_role_session_name)
- [iam\_web\_identity\_token](#iam_web_identity_token)
- [terraform\_binary](#terraform_binary)
- [terraform\_version\_constraint](#terraform_version_constraint)
- [terragrunt\_version\_constraint](#terragrunt_version_constraint)
- [retryable\_errors](#retryable_errors)
- [inputs](#inputs)
- [download\_dir](#download_dir)
- [prevent\_destroy](#prevent_destroy)
- [skip](#skip) (DEPRECATED: Use [exclude](#exclude) instead)
- [iam\_role](#iam_role)
- [iam\_assume\_role\_duration](#iam_assume_role_duration)
- [iam\_assume\_role\_session\_name](#iam_assume_role_session_name)
- [iam\_web\_identity\_token](#iam_web_identity_token)
- [terraform\_binary](#terraform_binary)
- [terraform\_version\_constraint](#terraform_version_constraint)
- [terragrunt\_version\_constraint](#terragrunt_version_constraint)
- [retryable\_errors](#retryable_errors) (DEPRECATED: Use [errors](#errors) instead)

### inputs

Expand Down Expand Up @@ -1520,6 +1522,8 @@ prevent_destroy = true

### skip

**DEPRECATED: Use [exclude](#exclude) instead.**

The terragrunt `skip` boolean flag can be used to protect modules you don’t want any changes to or just to skip modules
that don’t define any infrastructure by themselves. When set to true, all terragrunt commands will skip the selected
module.
Expand Down Expand Up @@ -1662,6 +1666,8 @@ terragrunt_version_constraint = ">= 0.23"

### retryable_errors

**DEPRECATED: Use [errors](#errors) instead.**

The terragrunt `retryable_errors` list can be used to override the default list of retryable errors with your own custom list.
To learn more about the `retryable_errors` attribute, see the [auto-retry feature overview](/docs/features/auto-retry).

Expand Down

0 comments on commit fd2f8ea

Please sign in to comment.