Development overrides for providers under development

Hi @CyrusJavan,

I’m sorry to hear this new feature is conflicting with your existing workflow.

Indeed, the intent of the lock file is, in a sense, to prevent the very thing you are doing: once there’s a v99.0.0 of myprovider.com/myprovider/myprovider then that version is expected to be immutable and any later changes will be a different release.

However, we knew that since the new provider addressing approach in v0.13 it’s been awkward to do provider development, and so Terraform v0.14 also includes a new mechanism specifically for that use-case: Development Overrides.

This mechanism causes Terraform to ignore the published versions of a given provider altogether and instead to just use a specific local directory regardless of which version is selected. You can enable it in the CLI configuration file (which is not the same as .tf files) using a dev_overrides block within a provider_installation block:

provider_installation {
  dev_overrides {
    "myprovider.com/myprovider/myprovider" = "/path/to/directory"
  }
}

The directory you specify here must contain, in this case, an executable file with the prefix terraform-provider-myprovider, with a directory structure the same as you’d get when unzipping a published provider distribution package.

This mechanism is a bit different than the existing provider installation methods because it isn’t really an installation method at all. Instead, it directs Terraform to totally ignore what terraform init selected and use the given directory as the implementation of that particular provider instead.

Notice that the override isn’t versioned at all, because it’s the main Terraform operations – terraform plan, terraform apply, etc – which are paying attention to this setting, rather than terraform init. Because the provider installer is being ignored entirely here, the version number is irrelevant and version constraints in the configuration will only affect what terraform init does, not what the other commands do.

I hope this new mechanism will be more convenient for you than the workaround of publishing with a placeholder version number that you were following before.