In Terraform, a resource provider is a set of operations for a specific service, and each one defines what types of resources can be deployed and managed by Terraform.
A provider is normally configured in the relevant technical or environment stack of the Terraform Workspace.
Most of the providers I employed were pretty simple, but when it came to using Mongo, I had to use the following example:
The provider above uses both the Azure and Mongo providers, set to the version mentioned (at the time of the screenshot)
I also specify the Azure subscription associated, the second provider one using an alias.
Finally, I didn’t wish to store the API private key and secret in this file as that isn’t best practice, so I reference a data resource for a Key Vault and the secrets where this information is kept.
This provider file is part of a module where Mongo resources are created, so it was also required. Normally, a module would not need a provider.