Run Terragrunt units without rebuilding the context

Keep your Terragrunt structure in Git. Save the directory, workspace and inputs in Semaphore, then give your team a clear way to plan and run each operation.

Which infrastructure unit will this command affect?

In a Terragrunt repository, the starting directory and arguments define the scope. A remembered command is not enough to hand the operation to someone else.

Make the unit and its inputs part of the job

  • Save the directory containing terragrunt.hcl
  • Choose the workspace and Terraform or OpenTofu runtime
  • Review the affected units in the task output

Make Terragrunt operations easier to repeat

Plan one infrastructure unit

Point a template at a network, database or application unit. Make its scope visible before starting the plan.

Share a prepared job

Reuse the same repository across environments

Create named templates for the relevant environment directories and Variable Groups. Keep shared configuration in Git.

Share a prepared job

Coordinate a wider infrastructure change

Configure the multi-unit arguments your Terragrunt version supports. Terragrunt evaluates module dependencies and Semaphore records the task output.

Connect jobs in a Workflow

Choose a Terragrunt unit and inspect its plan

Take a Terragrunt rollout through to service readiness

Keep module dependencies in Terragrunt. Use a Workflow to pass its outputs to Ansible configuration and follow with Python service checks. Add a diagnostics branch when a task fails.

Infrastructure rolloutWorkflow
Run infrastructure units
On successOutputs → inputs
Configure the systems
On successOutputs → inputs
Verify the service
On failure
Collect diagnostics

The directory, toolchain and state behind each run

Save the entry directory

Select the repository subdirectory containing terragrunt.hcl. Use separate named templates when different units or environments need distinct entry points.

Prepare Terragrunt and its underlying binary

Enable Terragrunt Code in Applications. Install terragrunt and the Terraform or OpenTofu binary on the server or runner, and test the version combination used by your repository.

Reuse variables and workspace settings

Variable Groups supply environment inputs, including TF_VAR_ values. Select a Terragrunt workspace inventory and use the backend configured for the operation.

Keep module dependencies in Terragrunt

Terragrunt evaluates the dependencies within its configuration. Semaphore Workflows coordinate separate Task Templates. Configure multi-unit CLI arguments for the installed Terragrunt release.

FAQ

Why is Terragrunt missing from the application choices?

Enable Terragrunt Code in Applications before creating the template. The application is disabled by default. Also install terragrunt and the Terraform or OpenTofu binary it will use on the server or runner that executes the task.

Which repository directory should a Terragrunt template use?

Select the subdirectory containing the terragrunt.hcl for the intended operation. Its directory and command arguments determine the scope. Use named templates for distinct units or environments so the team can recognize what a task will operate on before starting it.

Can Terragrunt use OpenTofu instead of Terraform underneath?

Yes. The Semaphore integration supports Terraform or OpenTofu as the underlying binary. Prepare both Terragrunt and the selected binary on the execution environment. Test their version combination with your configuration and provide the required module, provider and backend access.

Can I run several Terragrunt units from one template?

You can configure multi-unit operations through the template’s CLI arguments. Use the command syntax supported by your installed Terragrunt version. The working directory and arguments determine which units are affected, while Terragrunt evaluates their module dependencies.

Can I schedule a Terragrunt plan for a specific unit?

Yes. Save the intended unit directory and workspace in a Terragrunt Task Template, configure Plan-only execution and add a schedule. Each scheduled task keeps its own output. Check the command scope before using it for recurring multi-unit work.

How are Terragrunt dependencies different from Semaphore Workflows?

Terragrunt evaluates dependencies between its infrastructure modules. A Semaphore Workflow coordinates Task Templates, which can use different tools. For example, a Terragrunt rollout can be followed by Ansible configuration and Python checks without replacing Terragrunt’s internal module dependency graph.

Can other teams run a saved Terragrunt operation?

Yes. Give teammates the project access required to run the prepared template. Save a clear entry directory, workspace and inputs so they can recognize its scope. Enterprise custom roles can restrict access to selected templates when broader project access is unnecessary.

How do I pass variables into a Terragrunt job?

Attach Variable Groups for environment inputs, including TF_VAR_ values used by the underlying configuration. Extra variables and Survey Variables are passed as supported run inputs. Keep provider and backend credentials in secret entries rather than committing them to the repository.