Adopt Pipelines Gradually with Opt-in Environments

Rolling out Pipelines to an existing infrastructure repo can be challenging. By default, Pipelines detects and runs against every OpenTofu/Terraform unit it finds. That’s great for full coverage, but not so great when you’re trying to adopt Pipelines incrementally, especially when some units would trigger errors and block deploys.

To make this easier, we’ve added a new experimental feature flag:

PIPELINES_FEATURE_EXPERIMENT_IGNORE_UNITS_WITHOUT_ENVIRONMENT

When enabled, Pipelines will only operate on units that are explicitly assigned to an environment.

What this means in practice:

  • Changes to units with an environment are detected and processed as usual
  • Changes to units without an environment are ignored
  • New directories won’t be treated as accounts (with Account Factory) unless they belong to an environment
  • Plans/applies exclude all units without an environment from the Terragrunt DAG

This makes it much easier to onboard brownfield infrastructures gradually. Just define environments for the units you want Pipelines to manage, and leave everything else untouched.

How to enable

The change is available as of v4.1.0. This will become the default behavior in a future version of Pipelines. To take advantage today, set the following flag to "true" in your configuration file:

repository {
  env {
    PIPELINES_FEATURE_EXPERIMENT_IGNORE_UNITS_WITHOUT_ENVIRONMENT = true
  }
}

One important note:

Adding an environment to an existing unit won’t automatically trigger change detection. You’ll need to make a small change to the unit (even whitespace) before it runs in your pipeline.