Hello Terraform provider developers,
We’re excited to announce the general availability of version 2.0.0 of the Terraform Plugin SDK! We’ve been hard at work for a while now on this upgrade, and you all have helped us test it through the two release candidates in the last few months, so we’re excited to share that it’s ready for production use in your providers.
Better Errors and Warnings Through Diagnostics
Version 2.0.0 of the SDK brings a new
Diagnostics type, and new versions of the CRUD functions you’re used to that return this
Diagnostics type. This allows providers to return more accurate error information to users, surfacing the exact field in a resource that prompted an error, or returning multiple errors or even warnings at once. A new
diags package helps work with this new
More Accurate Timeouts
In addition to returning
Diagnostics, our new CRUD functions now accept
context.Contexts, which are used for more accurate timeout and cancellation within your provider code. You can upgrade to this enhanced version of the provider interface for a more reliable timeout experience.
More Accurate Test Runs
Our test framework has been reworked from the ground up to be more accurate and useful, without sacrificing any of its power. Test configurations are now applied by an actual Terraform binary, meaning what you see in tests is going to match what your users see in production much more closely. And test coverage and debuggers still work with the test framework.
In addition to these features, version 2.0.0 brings bug fixes, clears up ambiguities, and helps make programming errors clearer. Version 2.0.0 is a more robust, accurate, and communicative SDK.
To get started in upgrading your provider, please see the upgrade guide. As always, the Terraform Plugin SDK team at HashiCorp is happy to answer any questions here in the forums, and we appreciate bug reports for any bugs you may encounter in the issue tracker.