I'm a little confused about what I'm reading in the terraform documentation. Here's what it says about modules:
https://www.terraform.io/docs/language/modules/index.html
Modules are containers for multiple resources that are used together. A module consists of a collection of .tf and/or .tf.json files kept together in a directory.
Here's what it says about providers: https://www.terraform.io/docs/language/providers/requirements.html
Requiring Providers
Each Terraform module must declare which providers it requires, so that Terraform can install and use them. Provider requirements are declared in a required_providers block.
A provider requirement consists of a local name, a source location, and a version constraint:
terraform { required_providers { mycloud = { source = "mycorp/mycloud" version = "~> 1.0" } } }
I'm confused about this because I never have specified required_providers in any of my modules, even though I'm using providers and it says I must do so. I didn't even know the documentation said this until today.
So am I misinterpreting the documentation, or is the documentation wrong? Does each of my modules need required_providers or not? My terraform configuration definitely works without them, so are they defaulting to something? If yes, how and where?