terragrunt
Provides a single flexible `run` function that executes any terragrunt commandin the configured container with SSH agent forwarding and environment variable support.
Example usage:
dagger call run --source=. --stack-dir=staging/my-stack --ssh-socket=/run/user/1000/ssh-agent.socket --command="stack run plan"
dagger call run --source=. --stack-dir=staging/my-stack --ssh-socket=/run/user/1000/ssh-agent.socket --command="stack run apply --non-interactive"
Installation
dagger install github.com/sflab-io/daggerverse/terragrunt@c2d3efa7674333a7d1f1d92406e691f4cc32f24fEntrypoint
Return Type
Terragrunt Example
dagger -m github.com/sflab-io/daggerverse/terragrunt@c2d3efa7674333a7d1f1d92406e691f4cc32f24f call \
func (m *MyModule) Example() *dagger.Terragrunt {
return dag.
Terragrunt()
}@function
def example() -> dagger.Terragrunt:
return (
dag.terragrunt()
)@func()
example(): Terragrunt {
return dag
.terragrunt()
}Types
Terragrunt 🔗
run() 🔗
Runs an arbitrary terragrunt command in the given directory.
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | - The repository root directory to mount into the container |
| stackDir | String ! | - | - Relative path to the working directory (e.g. "staging/proxmox-k3s-vms") |
| sshSocket | Socket ! | - | - SSH agent socket for git authentication |
| command | String ! | - | - The terragrunt command to run (e.g. "stack run plan", "stack run apply --non-interactive") |
| envVars | [String ! ] | - | - Environment variables as KEY=VALUE strings (e.g. "AWS_ACCESS_KEY_ID=abc") |
Example
echo 'Custom types are not supported in shell examples'func (m *MyModule) Example(ctx context.Context, source *dagger.Directory, stackDir string, sshSocket *dagger.Socket, command string) string {
return dag.
Terragrunt().
Run(ctx, source, stackDir, sshSocket, command)
}@function
async def example(source: dagger.Directory, stack_dir: str, ssh_socket: dagger.Socket, command: str) -> str:
return await (
dag.terragrunt()
.run(source, stack_dir, ssh_socket, command)
)@func()
async example(source: Directory, stackDir: string, sshSocket: Socket, command: string): Promise<string> {
return dag
.terragrunt()
.run(source, stackDir, sshSocket, command)
}