Trusted provider installation
Trust the executable, not just its name
A provider runs code on the machine performing Terraform operations. A name resembling a familiar publisher does not establish provenance. Before installation, confirm the full source address, intended release, publisher, platform, approved distribution location and any applicable license or security review. A checksum identifies content, not whether that content is safe. A valid publisher signature helps establish who endorsed a package, provided that you trust the signing identity. Do not initialize unknown configuration to discover what it installs.
Use an explicitly approved mirror
A filesystem mirror holds reviewed packages in the layout expected by Terraform. A network mirror is an HTTPS distribution service; it is not inherently a trusted origin. The following is an illustrative CLI configuration file, not a module .tf file. The provider and directory are fictional placeholders. Do not run it.
provider_installation { filesystem_mirror { path = "/approved/lab/providers" include = ["registry.example.com/learning/demo"] }}Only the selected installation method is declared, so there is no direct registry fallback for external providers. In a real isolated lab, supply a reviewed absolute path through TF_CLI_CONFIG_FILE. If other external dependencies are required, they must have their own approved installation route. A mirror is not a guarantee of total offline operation: remote module sources, backends, CLI settings and provider API operations are separate concerns. A plugin cache is a performance optimization, not an authoritative source.
Prepare packages and checksums for target platforms
A release may have different archives for Linux x86-64 and macOS ARM64. Record the platforms your team actually needs. In a separately authorized dependency-preparation environment, these are example command shapes for an already reviewed real configuration, not commands for the fictional demo provider:
terraform providers lock -platform=linux_amd64 -platform=darwin_arm64terraform providers mirror -platform=linux_amd64 -platform=darwin_arm64 /approved/lab/providersThe lock command can consult origin registries and record verified checksums for the requested platforms; review signer identity and output. The mirror command copies packages into the mirror layout and may contact external services. For approved internal providers, lock entries can instead be derived from a trusted local mirror using -fs-mirror; those digests are not evidence of origin-publisher signatures. Do not fabricate hashes or bundle executable packages in this lesson. Both commands are unexecuted here.
Review an installation failure safely
A mismatch between an acquired package and a recorded digest is a stop signal. Preserve the trusted lockfile, quarantine the unexpected file and verify the source, version, architecture and signed release metadata. A missing platform checksum is different from an unexpected package: establish the correct package through an approved origin and extend the lock in a reviewed change when appropriate. Do not disable checksum checks, remove lock entries or download from an arbitrary mirror to make a run pass. A successful init is not proof of correct infrastructure or harmless code.
Build an offline approval decision
For the fictional training release, imagine that Linux package verification passed but the macOS artifact was absent. Approve only the reviewed Linux artifact for its intended environment; block the macOS installation until the correct package is obtained and verified. If a package has the right version label but a different digest, reject it pending investigation. In the offline fixture, all evidence is synthetic, and no packages are installed. Next: use count to create multiple instances with predictable addresses.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Trusted provider installation — knowledge check
Check dependency selection, installation policy and package trust.
Why review a provider before loading it?
What does a checksum match alone establish?
What should happen after an unexpected digest mismatch?
What is a plugin cache primarily for?
Does the example mirror-only configuration allow direct external provider installation?