New to Kestra?
Use blueprints to kickstart your first workflows.
Promote infrastructure environment by environment with Kestra and Terragrunt. Scope run-all apply to dev, staging, or prod and confirm each apply in Slack.
Promote infrastructure the way you promote code, environment by environment, with an audit trail. Terragrunt mono-repos typically keep one folder per environment under live, and the promotion discipline is simple: apply dev, verify, apply staging, verify, apply prod. This blueprint encodes that discipline as a Kestra flow. A SELECT input picks the environment, and terragrunt run-all apply is scoped to exactly that folder with --working-dir, so a prod promotion can never accidentally sweep up staging changes.
The demo repository ships inline through inputFiles: one shared root.hcl, one app unit per environment, and a single module that writes an environment-stamped local_file, so the flow runs end to end without cloud credentials.
environment input (SELECT, defaulting to dev) constrains executions to dev, staging, or prod, so the promotion target is always explicit and recorded on the execution.apply_environment (io.kestra.plugin.terragrunt.cli.TerragruntCLI) materializes the repo layout from inputFiles, then runs terragrunt run-all apply --non-interactive --working-dir live/{{ inputs.environment }}. The --working-dir scope means Terragrunt only discovers units inside the chosen environment folder.environment input to the shared module, so the same module code produces per-environment resources, the standard Terragrunt promotion pattern.confirm_promotion posts a Slack message naming the environment and the execution id, and the errors block posts a distinct failure alert that also names the environment.--working-dir, applying dev can never modify prod.A promotion run from a terminal leaves no record beyond shell history, and nothing stops a mistyped path from applying the wrong environment. Kestra gives the same command guardrails: the target is a constrained SELECT input, every execution stores its inputs and logs, Slack confirms success or failure by name, and Kestra's RBAC and execution history turn infrastructure promotion into a reviewable process instead of a trust exercise.
env from {{ secret('...') }} and configure remote state in root.hcl.SLACK_WEBHOOK_URL: Slack incoming webhook URL.SLACK_WEBHOOK_URL secret to your Kestra namespace.dev environment and check the Slack confirmation names dev.staging, then prod, to walk a full promotion path.inputFiles with namespaceFiles or a io.kestra.plugin.git.Clone task so promotions run against your real repository.run-all plan task before the apply and attach the plan log for reviewers, as shown in the Terragrunt run-all plan blueprint.tofu and setting TERRAGRUNT_TFPATH in the task env.