Terraform Provider
A Terraform provider is a plugin that lets Terraform manage resources on a specific platform such as AWS, Google Cloud, Azure, or GitHub. It translates your configuration into API calls for that platform.
What Is a Provider?
Terraform core does not know how to talk to AWS. The provider plugin handles authentication and API calls.
terraform { required_providers { aws = { source = "hashicorp/aws" version = "~> 5.0" # at least 5.0, below 6.0 } }} provider "aws" { region = "ap-south-1"}Run terraform init to download it. Never hardcode credentials. Use environment variables, profiles, or IAM roles. Use alias to configure the same provider twice, for example for two regions.
Common MistakeLeaving provider versions unpinned. A major upgrade can change schemas and turn a routine plan into a replacement.
Frequently Asked Questions
How is a provider different from a module?
A provider is a plugin that knows one platform's API. A module is a folder of your own Terraform code grouped for reuse.
How do I upgrade a provider safely?
Change the version constraint, run terraform init -upgrade, read the changelog, review the plan, and commit the updated lock file.