liveBook · Manning

Terraform provider

As explained in Bootstrapping Microservices, Second Edition: With Docker, Kubernetes, GitHub Actions, and Terraform

A Terraform provider is a plugin that enables Terraform to interact with a specific infrastructure platform or service through its API.

A Terraform provider is a plugin that extends Terraform for a particular infrastructure platform. Providers let Terraform create and configure resources across cloud vendors, including Azure, AWS, and Google Cloud. section 7.7.1 section 7.7

Configure and use a provider through a small operational workflow:

  • Declare the provider in providers.tf, including its source and preferably a constrained version. section 7.8.3
  • Run terraform init before executing Terraform code; initialization downloads providers required by the project. section 7.8.4
  • Reuse the cached plugins stored under .terraform, and initialize again when a new provider is added. section 7.8.5 section 7.8.4

Pinning the Azure provider

A minimal configuration requires hashicorp/azurerm, constrains it to the 3.71 release line, and enables the provider with features {}. Running terraform init then installs the selected provider and prepares the project for execution. section 7.8.3 section 7.8.4

Listing 7.2 Configuring Terraform provider plugins
terraform {
  required_providers {
    azurerm = {                        #1
      source = "hashicorp/azurerm"
      version = "~> 3.71.0"            #2
    }
  }
 
  required_version = ">= 1.5.6"        #3
}
 
provider "azurerm" {
  features {}                          #4
}

Inspect the complete providers.tf configuration, including the provider source, version constraint, Terraform version requirement, and Azure features block. section 7.8.3

How Bootstrapping Microservices, Second Edition: With Docker, Kubernetes, GitHub Actions, and Terraform covers it

How deep it goes
Explains declaration, version pinning, initialization, downloading, and caching, but does not detail provider implementation internals.
Examples
Uses an Azure resource group, providers.tf, terraform init, the .terraform cache, and an azurerm version constraint.
What it assumes
Assumes basic Terraform and configuration-code familiarity while teaching provider declaration and initialization directly.
What you can do after
Operate/configure Terraform projects that download, constrain, and use providers for cloud infrastructure.
How it connects
Connects Terraform providers with HCL, infrastructure as code, cloud vendors, and Terraform state.

Also explained in

Compare how 4 books explain Terraform provider →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Bootstrapping Microservices, Second Edition: With Docker, Kubernetes, GitHub Actions, and Terraform. The section links point to the parts of the book it draws on.