github gruntwork-io/terragrunt v1.0.0-rc3

pre-release10 hours ago

🎉 v1.0.0 Release Candidate

This is the third, and final release candidate for Terragrunt v1.0.

This release introduces bug fixes, documentation updates, some final breaking changes, and some internal housekeeping since RC2. With the release of 1.0 in March, you can expect many stability guarantees from Terragrunt, which are documented here. You have roughly 2-3 weeks to influence the final 1.0 release, so make sure you try this release candidate out and share your feedback. If you have tried this release, make sure to share your feedback with an emoji or a comment on the associated GitHub Discussion.

You can learn more about the release candidate process in The Road to 1.0: Release Schedule blog post.

🛠️ Breaking Changes

Windows compatibility in file paths improved

All HCL functions now return operating system native file paths without forward slash normalization.

  • get_terragrunt_dir()
  • get_original_terragrunt_dir()
  • get_parent_terragrunt_dir()
  • get_path_from_repo_root()
  • get_path_to_repo_root()
  • find_in_parent_folders()
  • path_relative_to_include()
  • path_relative_from_include()

If you and your team do not work in Windows environments, you are unlikely to see any change as a consequence of this. If you do use Terragrunt in a Windows environment, Terragrunt will now return appropriate Windows file paths, with backslashes as file path separators instead of Unix-like forward slashes.

If you need to normalize paths, you can use the replace function to achieve this.

e.g.

remote_state {
  backend = "s3"

  generate = {
    path      = "backend.tf"
    if_exists = "overwrite_terragrunt"
  }

  config = {
    bucket = "my-tofu-state"

    key            = "${replace(path_relative_to_include(), "\\", "/"}/tofu.tfstate" # <--
    region         = "us-east-1"
    encrypt        = true
    dynamodb_table = "my-lock-table"
  }
}

📖 Documentation Updates

New Home for the Terragrunt website!

The Terragrunt website is now hosted at https://terragrunt.com and https://docs.terragrunt.com for marketing and documentation purposes, respectively.

Existing links to https://terragrunt.gruntwork.io should seamlessly redirect to the new domain that hosts the content for that URI.

🐛 Bug Fixes

Improved Error messages for undefined flags

Detection has been added for scenarios when a user is using a flag that might be meant to be passed to OpenTofu/Terraform in the run command, and suggests using the -- argument to pass it through.

As an example:

$ terragrunt run providers lock -platform linux_amd64 -platform darwin_arm64
14:52:19.496 ERROR  flag `-platform` is not a Terragrunt flag. If this is an OpenTofu/Terraform flag, use `--` to forward it (e.g., `terragrunt run -- <command> -platform`).

Improved log messages for hooks with errors

Hooks encountering errors will now return errors that better communicate whether an error was caused by failure to execute an external process or successfully running an external process, but receiving a non-zero exit code.

e.g.

11:39:03.648 INFO   Executing hook: before_hook
11:39:03.649 ERROR  Hook "before_hook" failed to execute: Failed to execute "non-existent-command" in ./.terragrunt-cache/_53N4ygp1LP9jdKsbtvistzGFqI/MqiE_Mt8XGTBVLRprAmyl66quoM

exec: "non-existent-command": executable file not found in $PATH

vs

11:38:17.694 INFO   Executing hook: before_hook
11:38:17.701 ERROR  Hook "before_hook" (command: bash -c exit 1) exited with non-zero exit code 1

More accurate matching of retryable errors

Fixes a bug where retries were triggered when an expected error is matched against non-stderr output from external process errors.

Duplicate error reporting fixed

Fixes a bug where duplicate errors were reported when running units through the worker pool subsystem.

Interaction between --working-dir and -detailed-exitcode fixed

Fixes a bug where the wrong cache key was used for storing exit codes for OpenTofu/Terraform runs in units when the --working-dir flag was also used.

Variable sanitization via escaping added

Escaping added for interpolation expressions (e.g. ${foo} that are unlikely to be desired by users).

Removing usage of filepath.Abs and reducing usage of filepath.ToSlash

Usage of the Golang filepath.Abs and filepath.ToSlash standard library functions significantly reduced. Overly broad application of these functions to file paths caused subtle operating system compatibility issues and incompatibility with the --working-dir flag.

The codebase has been updated to only use filepath.Abs early on in initialization of the CLI prior to setting the value of --working-dir (after which, working dir is considered the source of truth for file path canonicalization) and tests. The codebase has been updated to use filepath.ToSlash only where unix-style forward slash normalization is a requirement (e.g. when used in file path globs).

Handling of backend init when disable_init=true

Fixes a bug where disable_init = true affected behavior beyond Terragrunt’s bootstrap operations. disable_init now correctly limits its scope to Terragrunt bootstrap steps only.

Fix detection of offline usage in Provider Cache Server

A bug in the detection of offline usage in the Provider Cache Server resulted in attempts to reach the default provider registry for OpenTofu/Terraform to trigger errors even when using the Provider Cache Server to proxy requests to a network or filesystem mirror.

This has been fixed. When the default provider registry isn’t available for OpenTofu/Terraform for any reason, the Provider Cache Server will use the provided network/filesystem mirror instead without attempting to use the discovery endpoint. This will help users in air-gapped environments using the Provider Cache Server.

Provider Cache Server used for fetching outputs from dependencies

The Provider Cache Server is now used when fetching outputs from dependencies, improving performance of output resolution for users using the provider cache server.

Relative paths in reading files fixed

A bug in the logic for incorporating includes as absolute paths in tracked “read” files has been fixed.

Ambiguous unit/stack components now throw errors

Previously, Terragrunt would silently engage in undefined behavior when both a terragrunt.hcl and terragrunt.stack.hcl file existed in the same directory.

With this release, Terragrunt will start to throw warnings and prevent such usage. Users will have to ensure that only one of a unit (terragrunt.hcl) or stack configuration (terragrunt.stack.hcl) exist in a unit or stack directory, respectively.

🧹 Chores

Refactoring to move filter parsing higher

Refactored parsing logic for the --filter flag to allow filter parsing to happen much earlier, improving safety and reliability.

Added testing to verify resolution of #3080

Added testing to verify incidental resolution of #3080.

What's Changed

  • fix: Improving error message for undefined flags by @yhakbar in #5571
  • fix: Increasing accuracy of retryable errors match by @yhakbar in #5568
  • fix: duplicate error reporting in worker pool by @anuragrao04 in #5526
  • fix: Fixing incremental lint issue by @yhakbar in #5592
  • fix: Fixing detailed-exitcode when used in combination with -working-dir by @yhakbar in #5590
  • fix: variables values interpolation by @denis256 in #5585
  • fix: Removing usage of filepath.Abs in production code and reducing usage of filepath.ToSlash by @yhakbar in #5597
  • fix: handling of backend init when disable_init=true by @denis256 in #5594
  • fix: Assume any transport errors to discovery URL are a sign that the user is offline by @yhakbar in #5615
  • fix: Fixing CORS for terragrunt.com by @yhakbar in #5631
  • fix: Fixing relative paths in tracked reading files by @yhakbar in #5651
  • fix: Fixing #4556 by @yhakbar in #5640
  • docs: Documenting -queue-strict-include deprecation in strict controls by @yhakbar in #5581
  • docs: Setting up migration to docs.terragrunt.com by @yhakbar in #5514
  • docs: Fixing redirect for /contact-tgs by @yhakbar in #5636
  • docs: Fixing 404s by @yhakbar in #5637
  • docs: Fixing Migrating Deprecated Attributes by @yhakbar in #5638
  • docs: Moving docs-starlight to docs by @yhakbar in #5635
  • docs: compatibility table updates by @denis256 in #5609
  • chore: Compile filter globs earlier by @yhakbar in #5574
  • chore: Adding lll lint incrementally by @yhakbar in #5582
  • chore: lint cache key update by @denis256 in #5588
  • chore: Reducing dependency on opts in config - Part Two by @yhakbar in #5563
  • chore: Removing Terratest dependency by @yhakbar in #5614
  • chore: Reducing dependency on opts in config - Part Three by @yhakbar in #5569
  • chore: Reducing dependency on opts in config - Part Four by @yhakbar in #5573
  • chore: Removing imports of options from tf by @yhakbar in #5583
  • chore: Removing options from shell by @yhakbar in #5584
  • chore: Removing options from awshelper by @yhakbar in #5587
  • chore: Removing options from runner and remotestate by @yhakbar in #5589
  • chore: Moving filters to opts by @yhakbar in #5591
  • chore: Addressing review feedback from #5597 by @yhakbar in #5604
  • chore: Addressing #5589 feedback by @yhakbar in #5633
  • chore: Adding test to verify that the Provider Cache Server is used when fetching outputs from dependencies by @yhakbar in #5611
  • chore: Verifying fix for #3080 by @yhakbar in #5639
  • chore: improved log message for failing hooks by @denis256 in #5603
  • chore: handling of terragrunt and stack files by @denis256 in #5645
  • chore: Adding external testing for config by @yhakbar in #5653
  • chore(deps): aws-sdk-go-v2 version bump by @denis256 in #5610
  • chore(deps): sops v3.12.1 gcp storage v1.60.0 by @denis256 in #5618
  • chore(deps): bump fast-xml-parser, @aws-sdk/client-s3, @aws-sdk/client-dynamodb, @aws-sdk/lib-dynamodb and @aws-sdk/s3-request-presigner in /docs-starlight/src/fixtures/terralith-to-terragrunt/app/best-cat by @dependabot[bot] in #5578
  • chore(deps): bump actions/stale from 10.1.1 to 10.2.0 by @dependabot[bot] in #5600
  • chore(deps): bump digicert/ssm-code-signing from 1.1.1 to 1.2.1 by @dependabot[bot] in #5527
  • chore(deps): bump the js-dependencies group across 1 directory with 9 updates by @dependabot[bot] in #5602
  • chore(deps): bump actions/download-artifact from 7.0.0 to 8.0.0 by @dependabot[bot] in #5626
  • chore(deps): bump actions/upload-artifact from 6.0.0 to 7.0.0 by @dependabot[bot] in #5627
  • chore(deps): bump actions/setup-go from 6.2.0 to 6.3.0 by @dependabot[bot] in #5628
  • chore(deps): bump github.com/cloudflare/circl from 1.6.1 to 1.6.3 in /test/flake by @dependabot[bot] in #5620
  • chore(deps): go dependencies update by @denis256 in #5634
  • chore(deps): bump jdx/mise-action from 3.6.1 to 3.6.2 by @dependabot[bot] in #5647

New Contributors

Full Changelog: v1.0.0-rc2...v1.0.0-rc3

Don't miss a new terragrunt release

NewReleases is sending notifications on new releases.