Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 4, 2025

Terragrunt's --tf-path parameter was hardcoded to terraform, preventing use of OpenTofu or other Terraform-compatible binaries.

Backend Changes

  • Added TfPath field to TerraformTemplateParams (optional, defaults to "terraform")
  • Updated all Terragrunt command invocations in TerraformApp.go to use configurable tf-path:
    • init(), isWorkspacesSupported(), selectWorkspace()
    • Plan(), Apply(), Run()

Frontend Changes

  • Added text input field in template form (visible only for terragrunt app type)
  • Field appears after backend filename setting
  • Placeholder shows "terraform" as default

Usage

// Template configuration
{
  "tf_path": "tofu"  // or "opentofu", or "/usr/local/bin/tofu"
}

// Generated Terragrunt commands
terragrunt init --tf-path=tofu
terragrunt plan --tf-path=tofu
terragrunt apply --tf-path=tofu

Empty/unset values default to "terraform" for backward compatibility. User input is safely passed as literal arguments via exec.Command().

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • dmin
    • Triggering command: ./bin/semaphore setup (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

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 2 commits November 4, 2025 12:52
Co-authored-by: fiftin <914224+fiftin@users.noreply.github.com>
Co-authored-by: fiftin <914224+fiftin@users.noreply.github.com>
Copilot AI changed the title [WIP] Add support for opentofu in terragrunt Add configurable tf-path parameter for Terragrunt templates Nov 4, 2025
Copilot AI requested a review from fiftin November 4, 2025 13:04
Copilot finished work on behalf of fiftin November 4, 2025 13:04
@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