Terragrunt
Run an existing Terragrunt unit as an Atmos Terraform component. This example uses OpenTofu, local state, and a built-in `terraform_data` resource. It requires no cloud credentials.
Try it out
- Install Atmos
- Try the example
Copy the example into a new directory and make it your own:
atmos init examples/terragrunt
cd terragrunt
Follow the README for prerequisites and next steps.
See it in action
RECORDED DEMO Terragrunt
Run an existing Terragrunt unit as an Atmos Terraform component. This example uses
OpenTofu, local state, and a built-in terraform_data resource. It requires no cloud credentials.
Discover and plan
With Atmos and OpenTofu installed, run these commands from the example directory:
atmos list instancesatmos terraform plan demo -s live
On first use, atmos list instances installs the plugin declared in atmos.yaml,
writes .atmos.plugins.lock.yaml, and lists component demo in stack live.
You can also run atmos plugin install to install it up front. Commit the lockfile
before running in CI so Atmos can restore the same release.
The plan shows one resource to add. Its input is HELLO FROM TERRAGRUNT,
which the unit computes with the HCL upper function.
Apply and clean up
atmos terraform apply demo -s liveatmos terraform output demo -s live -- -raw greetingatmos terraform destroy demo -s live
Use in your own project
To add the plugin to your project's atmos.yaml and install it, run:
atmos plugin install oci://ghcr.io/cloudposse/atmos/plugins/terragrunt \--as=terragrunt --version='^0.1.0'
See Enable Terragrunt support to configure discovery for your project's units.