Terraform Plugin Framework Is Now Generally Available
The Terraform Plugin Framework 1.0 is now generally available to provide a modern and extensible way for developers to create Terraform providers.
We are excited to share that Terraform Plugin Framework version 1.0.0 is now generally available (GA). The Terraform Plugin Framework is the successor to the Terraform Plugin SDKv2, and forms the basis for creating Terraform providers. Terraform relies on a type of plugin called a provider to interact with cloud resources, SaaS platforms, and other APIs. Providers are at the heart of Terraform’s extensibility for multi-cloud provisioning, and the ecosystem now includes more than 2,700 public providers in the Terraform Registry.
In this post, we’ll discuss why we changed the way Terraform providers are built and review the new features in the 1.0 release.
» A New Way to Build Terraform Providers
Providers are executable binaries written in Go that communicate with Terraform Core over an RPC interface. While Terraform providers have traditionally been developed using the Terraform Plugin SDKv2, Terraform functionality and Go coding standards have evolved considerably over the years. To continue providing a great user experience for plugin development, we redesigned our provider authoring tools from the ground up using familiar, idiomatic patterns while prioritizing extensibility and concise abstractions. The result was our new Plugin Framework. The Plugin Framework’s code is more maintainable and future-proof, and it will serve as the foundation for future Terraform plugin development features and tooling.
Terraform Plugin SDKv2 technology will continue to exist alongside the Plugin Framework, but we recommend that provider developers adopt the new Plugin Framework to make use of the latest features. Going forward, new features and tooling will be prioritized for the Plugin Framework.
» What’s New in Terraform Plugin Framework 1.0
- Validators give users feedback about required syntax, types, and acceptable values. The Plugin Framework offers a collection of pre-built validators that solve many common use cases, such as checking string lengths and numeric ranges.
- Path expressions provide additional flexibility when traversing resource or datasource schemas. For instance, the presence of an attribute within a Terraform configuration may be valid or not depending upon the presence of another attribute. A path expression allows the relationship between these attributes to be specified as a relative path.
- Nested attributes allow schemas to be defined using objects of attributes that fully support attribute behaviors. Examples include required, optional, computed, plan modifiers, and validators.
- Resource private state management provides a way to store data alongside state but without exposing it to Terraform plans. It is generally for advanced use cases such as storing and retrieving values that do not need to be shown to users, such as ETags used within API calls.
- Custom types can be used for attributes within a schema where augmentation of a base type is required. For example, a custom type could be used to wrap a string and provide additional functionality such as the ability to parse and format the string as a timestamp.
- Plugin Framework-based providers can be made backward compatible with Terraform versions 0.12 and later. Provider developers can opt to use the newer Terraform Plugin Protocol version 6 for access to the latest features in Terraform 1.x.
» Getting Started with the Terraform Plugin Framework
The tutorials available on the HashiCorp Developer site are the best places to start if you are new to plugin development. You can begin by reading this getting started page, and then continue exploring our provider-development documentation collection. If you are interested in migrating an existing provider to the Plugin Framework, please take a look at our migration guide.
For more insight, check out some of the providers already developed using the Plugin Framework: AWS Cloud Control, HTTP , null, TLS, time, and random.
Please file any bugs you encounter, let us know about your feature requests, and share other questions, thoughts, and experiences in the Terraform discussion forum. We’d love to hear from you, and we can’t wait to see what our partners and the community build with this new framework.
Sign up for the latest HashiCorp news
More blog posts like this one
New Terraform integrations with Crowdstrike, Datadog, JFrog, Red Hat, and more
12 new Terraform integrations from 9 partners provide more options to automate and secure cloud infrastructure management.
Terraform delivers launch-day support for Amazon S3 Tables, EKS Hybrid Nodes, and more at re:Invent
The Terraform provider for AWS now enables users to manage a variety of new services just announced at re:Invent.
HashiCorp at re:Invent 2024: Infrastructure Lifecycle Management with AWS
A recap of HashiCorp infrastructure news and developments on AWS from the past year, from a new provider launch to simplifying infrastructure provisioning and more.