New Terraform Tutorials on Using and Creating Custom Terraform Providers
Learn how to create a custom Terraform provider with this new collection of Terraform tutorials on HashiCorp Learn.
Terraform providers serve as bridges between the Terraform Core and target APIs. We have created a collection of tutorials to show you how to use and create custom Terraform providers. The example provider interacts with a fictional coffee-shop application, HashiCups.
In the first tutorial, Perform CRUD Operations with Providers, you will use the Terraform HashiCups provider to create, read, update, and delete HashiCups resources. In the process, you will be able to see how the provider interacts with the HashiCups API by viewing the HashiCups logs. This tutorial also highlights new updates that Terraform 0.13 brings to providers, such as defining provider source in your configuration and where providers are locally stored.
The remaining tutorials walk you through re-creating the Terraform HashiCups provider using the Terraform Plugin SDK v2.
- In Setup and Implement Read, you will set up the Terraform provider boilerplate and define a Terraform data resource. This allows you to retrieve information from external APIs to use in your Terraform configuration.
- In Add Authentication to a Provider, you will add authentication to the HashiCups provider. This allows you to access protected endpoints so you can create, update, and delete resources.
- In Implement Complex Read, you will add a data source from a protected endpoint. The data model is nested and contains many different data types. As a result, you will use flattening functions to convert the API’s JSON response into a `schema.Resource`.
- In Debug a Terraform Provider, you will add warning and error messages to the provider using `diag.Diagnostics`. This type is new to Terraform Plugin SDK v2 and aims to assist users through debugging.
- In Implement Create, you will add functionality to create a new resource to the provider.
- In Implement Update, you will add functionality to update a resource to the provider.
- In Implement Delete, you will add functionality to delete a resource to a provider.
By the end of this collection, you will be able to take these intuitions to create your own custom Terraform provider.
Sign up for the latest HashiCorp news
More blog posts like this one

HashiCorp at re:Inforce: Advancing Security Lifecycle Management with AWS
HashiCorp will be at AWS re:Inforce 2025 sharing expert talks, product demos, and news announcements.

Terraform ephemeral resources, Waypoint actions, and more at HashiDays 2025
HashiCorp Terraform, Waypoint, and Nomad continue to simplify hybrid cloud infrastructure with new capabilities that help secure infrastructure before deployment and effectively manage it over time.

Terraform migrate 1.1 adds VCS workspace support and enhanced GitOps
Terraform migrate 1.1 adds support for VCS workspaces, expanded Git capabilities, and greater control through both the CLI.