github.com/graywolf-at-work-2/terraform-vendor@v1.4.5/docs/plugin-protocol/releasing-new-version.md (about) 1 # Releasing a New Version of the Protocol 2 3 Terraform's plugin protocol is the contract between Terraform's plugins and 4 Terraform, and as such releasing a new version requires some coordination 5 between those pieces. This document is intended to be a checklist to consult 6 when adding a new major version of the protocol (X in X.Y) to ensure that 7 everything that needs to be is aware of it. 8 9 ## New Protobuf File 10 11 The protocol is defined in protobuf files that live in the hashicorp/terraform 12 repository. Adding a new version of the protocol involves creating a new 13 `.proto` file in that directory. It is recommended that you copy the latest 14 protocol file, and modify it accordingly. 15 16 ## New terraform-plugin-go Package 17 18 The 19 [hashicorp/terraform-plugin-go](https://github.com/hashicorp/terraform-plugin-go) 20 repository serves as the foundation for Terraform's plugin ecosystem. It needs 21 to know about the new major protocol version. Either open an issue in that repo 22 to have the Plugin SDK team add the new package, or if you would like to 23 contribute it yourself, open a PR. It is recommended that you copy the package 24 for the latest protocol version and modify it accordingly. 25 26 ## Update the Registry's List of Allowed Versions 27 28 The Terraform Registry validates the protocol versions a provider advertises 29 support for when ingesting providers. Providers will not be able to advertise 30 support for the new protocol version until it is added to that list. 31 32 ## Update Terraform's Version Constraints 33 34 Terraform only downloads providers that speak protocol versions it is 35 compatible with from the Registry during `terraform init`. When adding support 36 for a new protocol, you need to tell Terraform it knows that protocol version. 37 Modify the `SupportedPluginProtocols` variable in hashicorp/terraform's 38 `internal/getproviders/registry_client.go` file to include the new protocol. 39 40 ## Test Running a Provider With the Test Framework 41 42 Use the provider test framework to test a provider written with the new 43 protocol. This end-to-end test ensures that providers written with the new 44 protocol work correctly with the test framework, especially in communicating 45 the protocol version between the test framework and Terraform. 46 47 ## Test Retrieving and Running a Provider From the Registry 48 49 Publish a provider, either to the public registry or to the staging registry, 50 and test running `terraform init` and `terraform apply`, along with exercising 51 any of the new functionality the protocol version introduces. This end-to-end 52 test ensures that all the pieces needing to be updated before practitioners can 53 use providers built with the new protocol have been updated.