Chapter Seven

Providers in Depth

How the AWS provider is configured, aliased, authenticated, version-constrained, and locked — the layer between your HCL and the cloud APIs it calls.

5 topics

A provider is the plugin that turns a Terraform plan into real API calls. Up to now it has been a single block you set the region on and forgot. This chapter opens it up: one configuration talking to two regions or two accounts at once, the credential chain that decides whether an apply works at all, and the two files — the version constraint and the lock — that keep every machine and every CI run resolving the same provider.

The AWS provider is the most volatile dependency in any AWS Terraform project. It ships a release most weeks and carries breaking changes across major versions, so the discipline here is not optional polish — it is what stops a routine init from quietly pulling in a breaking new major that renames the arguments your config relies on.

Topics in This Chapter