Provision using the Terragrunt Provision Step
You can use Terragrunt in Harness to provision the target infrastructure for a deployment or any other resources. Typically, Harness users provision the target infrastructure for a deployment and then deploy to it in the same Workflow.
This topic describes how to provision the target infrastructure for a deployment using the Workflow Terragrunt Provisioner step. The same information applies to provision non-target resources.
You use the Terragrunt Provisioner step in a Workflow to run the Terragrunt configuration file (and related Terraform scripts) you added in a Harness Terragrunt Infrastructure Provisioner.
During deployment, the Terragrunt Provisioner step provisions the target infrastructure and then the Workflow deploys to it.
The Harness Terragrunt Infrastructure Provisioner is supported in Canary and Multi-Service Workflows only. For AMI/ASG and ECS deployments, the Terragrunt Infrastructure Provisioner is also supported in Blue/Green Workflows.
Before You Begin
- Get an overview how how Harness supports Terragrunt: Terragrunt Provisioning with Harness.
- Ensure you have your Harness account settings prepared for Terragrunt: Set Up Your Harness Account for Terragrunt.
- Create a Harness Terragrunt Infrastructure Provisioner: Add Terragrunt Configuration Files.
- If you are provisioning the target infrastructure for a deployment you need to map Terraform outputs to the Infrastructure Definition used by the Workflow. See Map Dynamically Provisioned Infrastructure using Terragrunt.
In addition, the following related features are documented in other topics:
- Terragrunt Dry Run: the Terragrunt Provisioner step in the Workflow can be executed as a dry run, just like running the
terragrunt plan
command. The dry run will refresh the state file and generate a plan. See Perform a Terragrunt Dry Run. - Terragrunt Destroy: see Remove Provisioned Infra with Terragrunt Destroy.