Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 4, 2025

Terragrunt's --tf-path parameter was hardcoded to "terraform", preventing users from using OpenTofu or other Terraform-compatible binaries.

Changes

Backend

  • Added TfPath field to TerraformTemplateParams for storing the binary path
  • Updated TerraformApp to use configurable path via getTfPath() helper (defaults to "terraform")
  • Applied to all Terragrunt commands: init, workspace list/select, plan, apply

Frontend

  • Added "Terraform binary path" input field to template settings (Terragrunt only)
  • Configured field visibility, translation, and form constants

Usage

Users can now specify alternative binaries in Terragrunt template settings:

{
  "task_params": {
    "tf_path": "tofu"  // or "/usr/local/bin/tofu", or leave empty for "terraform"
  }
}

This generates commands like:

terragrunt init --tf-path=tofu
terragrunt plan --tf-path=tofu

Backward compatible: existing templates continue using "terraform" by default.

Original prompt

This section details on the original issue you should resolve

<issue_title>Feature: Terragrunt opentofu support</issue_title>
<issue_description>### Related to

Configuration, Other

Impact

nice to have

Missing Feature

It would be great if we could swap from terraform to opentofu in terragrunt. Currently this doesn't seem to be an option or isn't fully documented.

Implementation

If we could override the --tf-path=terraform param injected that would be great.

Design

No response</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 3 commits November 4, 2025 12:51
- Added TfPath field to TerraformTemplateParams to allow configuring the --tf-path parameter
- Updated TerraformApp to use configurable TfPath instead of hardcoded "terraform"
- Added frontend UI field for configuring tf-path in template settings for Terragrunt
- Default value remains "terraform" for backward compatibility

Co-authored-by: fiftin <[email protected]>
- Added DefaultTerraformBinary constant for the default terraform binary path
- Simplified tfPath initialization to let getTfPath() handle the default case
- Removed duplicate default logic from InstallRequirements

Co-authored-by: fiftin <[email protected]>
Copilot AI changed the title [WIP] Add Teragrunt support for opentofu Add configurable --tf-path for Terragrunt OpenTofu support Nov 4, 2025
Copilot finished work on behalf of fiftin November 4, 2025 13:13
Copilot AI requested a review from fiftin November 4, 2025 13:13
@fiftin fiftin closed this Nov 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: Terragrunt opentofu support

2 participants