Skip to content

Commit

Permalink
Add example terraform-plugin-framework provider to the docs (#149)
Browse files Browse the repository at this point in the history
* Add example terraform-plugin-framework provider

* Add framework_provider to Code Implementation section
  • Loading branch information
zliang-akamai authored Apr 11, 2023
1 parent a8efb0b commit aada173
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions website/docs/plugin/mux/combining-protocol-version-5-providers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ import (

"github.com/example/terraform-provider-example/internal/provider1"
"github.com/example/terraform-provider-example/internal/provider2"
"github.com/example/terraform-provider-example/internal/framework_provider"
"github.com/hashicorp/terraform-plugin-framework/providerserver"
"github.com/hashicorp/terraform-plugin-go/tfprotov5"
"github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server"
"github.com/hashicorp/terraform-plugin-mux/tf5muxserver"
Expand All @@ -68,6 +70,11 @@ func main() {
// Example terraform-plugin-sdk/v2 providers
provider1.New(version)().GRPCProvider,
provider2.New(version)().GRPCProvider,

// Example terraform-plugin-framework provider
providerserver.NewProtocol5(
framework_provider.New(version)(),
),
}

muxServer, err := tf5muxserver.NewMuxServer(ctx, providers...)
Expand Down Expand Up @@ -110,6 +117,11 @@ resource.Test(t, resource.TestCase{
// Example terraform-plugin-sdk/v2 providers
provider1.New(version)().GRPCProvider,
provider2.New(version)().GRPCProvider,

// Example terraform-plugin-framework provider
providerserver.NewProtocol5(
framework_provider.New(version)(),
),
}

muxServer, err := tf5muxserver.NewMuxServer(ctx, providers...)
Expand Down

0 comments on commit aada173

Please sign in to comment.