client-server

module
v0.0.0-...-5e5d570 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 20, 2026 License: MPL-2.0

README

Example Engine Client - Server implementation

Example implementation of the Terragrunt IaC engine to offload the running of OpenTofu commands on a remote server. Use it only for educational purposes since it allows execution of arbitrary bash commands on the server.

To build the client and server locally, run the make command:

make

This will build the terragrunt-engine-client and terragrunt-engine-server binaries.

Example Usage

This example includes a live directory with sample Terragrunt and Terraform configurations.

Starting the Server
  1. Build and start the server using Docker Compose:
docker compose up
Running Terragrunt
  1. Navigate to the live directory:
cd live
  1. Set the required environment variables:
export TG_EXPERIMENTAL_ENGINE=1
export TG_SERVER_TOKEN=secret-token
  1. Run Terragrunt commands:
terragrunt apply --auto-approve
Example Configuration

The live/terragrunt.hcl file contains the engine configuration:

# terragrunt.hcl
engine {
  source = "../terragrunt-engine-client"
  meta = {
    # server endpoint
    endpoint = "127.0.0.1:50051"
    # authentication token
    token    = get_env("TG_SERVER_TOKEN", "secret-token")
  }
}

End to end example: asciicast

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL