For the complete documentation index, see llms.txt. This page is also available as Markdown.

Default Pipelines

Learn how to use and auto-create Harness IaCM default pipelines to run Plan, Provision, Detect Drift, and Destroy operations directly from any workspace.

IaCM Default Pipelines offer a streamlined approach to provisioning, destroying, and managing infrastructure workspaces by allowing you to run your pre-configured pipelines directly from any workspace. These pipelines can be easily created and set as defaults at the project level, providing quick and consistent access across all workspaces. This functionality ensures a seamless experience and maintains uniformity throughout your infrastructure management.

In addition, as some workspaces may require specialized pipelines, you can overwrite the defaults at the workspace level. This will not disrupt any other workspace using the project level defaults.


Before you begin

  • IaCM permissions: View and Create/Edit permissions for IaCM Pipelines, and Edit permissions for Project Settings to configure IaCM Defaults. Go to RBAC in Harness to configure roles.

  • Existing pipelines: Required only if you want to manually assign default pipelines. If you enable auto-creation during workspace setup, Harness generates the pipelines for you. Go to Pipeline Operations to add operational features to your pipelines before assigning them as defaults.

Harness IaCM: Default Pipelines

Auto-creating default pipelines

When creating a workspace, you can enable the Set up auto-generated default pipelines toggle on the Provisioner step to have Harness automatically create default pipelines for all supported operations. Harness creates the pipelines asynchronously after workspace creation and immediately associates them with the workspace, so the Plan, Provision, and Check for Drift actions are available without any manual pipeline setup.

If project-level default pipelines already exist for the selected provisioner, Harness reuses them instead of creating duplicates. If the toggle is not shown during workspace creation, at least one project-level default already exists for that provisioner.

Generated pipelines by provisioner

Provisioner
Operation
Steps

Terraform / OpenTofu / Terragrunt

Plan

Init → Plan

Terraform / OpenTofu / Terragrunt

Drift

Init → Plan → Detect Drift

Terraform / OpenTofu / Terragrunt

Apply (Provision)

Init → Plan → Approval → Apply

Terraform / OpenTofu / Terragrunt

Destroy

Init → Plan (Destroy) → Approval → Destroy

AWS CDK

Synth

Bootstrap → Synth

AWS CDK

Diff

Bootstrap → Synth → Diff

AWS CDK

Drift

Bootstrap → Synth → Detect Drift

AWS CDK

Deploy

Bootstrap → Synth → Diff → Approval → Deploy

AWS CDK

Destroy

Bootstrap → Synth → Diff → Approval → Destroy

Auto-generated pipelines follow the naming convention iacm_auto_generated_<provisioner>_<operation>_pipeline, for example iacm_auto_generated_terraform_plan_pipeline and iacm_auto_generated_cdk_deploy_pipeline. You can override any auto-generated default with a custom pipeline from Project Settings → IaCM Settings → Default Pipelines or from the Configuration tab of an individual workspace.


Configure and run default pipelines

Harness IaCM: Default Pipelines

Set your project-level default pipelines

  1. In your IaCM module, select Project settings, then select IaCM Defaults.

  2. Select the appropriate pipelines for your default categories and frameworks (OpenTofu / Terraform):

    • Plan: Pipeline for running the plan only.

    • Provision: Pipeline for initializing, planning, approving, and applying changes.

    • Detect Drift: Pipeline for detecting drift between your configuration and provider state.

    • Destroy: Pipeline for initializing, planning, approving, and destroying infrastructure.

Review your default pipelines in your workspace

  1. Select Workspaces, then select one of your workspaces to run your default pipelines.

  2. Select the Configuration tab and scroll down to Default pipelines to inspect or override your default pipelines at the selected workspace-level (this will not affect your project level settings).

Run your default pipelines in your workspace

  1. While in your workspace, run your default pipelines against it with the Plan, Provision and Check for Drift buttons.

EXECUTE THE DESTROY PIPELINE

To prevent accidental execution, the Destroy pipeline is in your workspace's Configuration tab, under Danger Zone.

To run it, select Destroy workspace.

Review previously run pipelines by selecting your workspace and reviewing the Execution History tab.


Next steps

You have configured default pipelines at the project level and can now run Plan, Provision, and Detect Drift operations directly from any workspace.

  • Go to Pipeline Operations to add approval gates, drift detection, PR automation, and queue steps to your default pipelines.

  • Go to Remove and import resources to safely remove infrastructure resources from state without destroying them.

  • Go to Custom images to use your own Terraform or OpenTofu plugin images in your IaCM pipeline stages.

Last updated

Was this helpful?