Provider types and providers

A provider type identifies a Terraform provider plugin and its configuration schema. A provider supplies configuration values for one instance of that type. Both belong to an infrastructure. For example, one aws provider type can have separate configured providers for different accounts or regions.

Create and synchronize a provider type

On the infrastructure, create a provider type with these settings:

SettingExampleMeaning
NamerandomTerraform local provider name used by modules.
Linkhashicorp/randomTerraform provider source address.
Version3.6.3Provider version used during initialization.
Secret overrides/tokenOptional non-root JSON Pointers marking configuration values as secrets.

Names start with a lowercase letter and contain only lowercase letters, digits, and hyphens, up to 255 characters. Use a concrete version; the version field accepts letters, digits, _, ., and -, not version constraint syntax such as >= 3.0. The source cannot contain spaces.

Creating a provider type or changing its version starts a Sync schema job. Set the name and link when you create the type. Editing lets you change the version and secret overrides. The worker runs the infrastructure’s executable to obtain the provider schema. It needs access to the provider installation source. Synchronization supplies the schema used to build and validate provider configuration forms.

Open the provider type’s linked job to follow synchronization or inspect a failure. Use Sync schema for an explicit refresh or retry after the job finishes.

Create a configured provider

Create a provider, select its type, and fill in the configuration fields exposed by the schema. Provider names follow the same lowercase naming rule as provider types.

For example, the quick start creates dns-main from the dns type, with an update list that names the DNS server and its TSIG key. A cloud provider will instead need its own configuration according to its schema and authentication requirements.

Bind providers to modules

A scope’s Default provider supplies an unaliased provider binding to a block with no valued provider fields. A template can instead declare provider fields, allowing each block to select configured providers from the same infrastructure. Such fields produce Terraform provider bindings, not ordinary module variables.

Once a block has a valued provider field, the default provider is not additionally injected. For a module using multiple providers, declare every required binding explicitly. The local provider names and aliases must match the module’s requirements; see blocks with multiple providers.

Changes to provider configuration or versions affect future plans. Review affected scopes before applying.

InfraBuffet keeps every provider that a scope’s Terraform state refers to configured, so resources of deleted blocks can still be destroyed. To protect that state:

  • A provider cannot be renamed; its name is the alias Terraform records in state.
  • A provider cannot be deleted if it’s used either directly by at least one of the blocks or the provider is referenced int the scope’s state
  • A provider type cannot be deleted if it has a provider that falls under any of the conditions listed in the previous point