This chapter covers
- Using the Terraform Provider Scaffolding template to bootstrap your development
- Using Terraform Plugin Framework to build a provider
- Utilizing the provider, data, resource and function interfaces
- Creating your development environment and enabling local use
- Signing and publishing your module to a registry
Writing a Terraform provider is not something the average user of Terraform will ever have to do. The reality is that there are a huge number of providers already out there, and most developers can make do with what’s there. That being said, there are several reasons why a developer may decide to build a provider:
- If a team is building a platform they want other developers to use, then there’s a big advantage in allowing them to control that platform with Terraform. Most companies that are selling a developer-focused platform are likely to consider this, but it can also be true of teams building internal platforms.
- Teams that are using open source platforms without a provider already written may find themselves writing one. This is what we will be doing in this chapter.
- Now that it’s possible to create functions in providers, teams may find it useful for certain types of data processing. The open source Terraform Core Functions (https://mng.bz/BX2J) provider is a great example of this.