Skip to content

Commit 1994ac1

Browse files
tweaks for clarity (#2143)
This PR is just a suggestion - it wasn't very clear to me what "parameterization" means in the context of dynamic providers. It felt like it was referring to a very specific concept, but it didn't really go into what that was. It feels like we could wait to talk about it until we do have that doc and concept laid out. Feel free to ignore - these would've been my comments on #2137.
1 parent fc987f9 commit 1994ac1

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

dynamic/README.md

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
<!-- -*- fill-column: 110 -*- -->
22
# Dynamic Bridged Provider
33

4-
A *dynamically bridged provider* is a Pulumi native provider parameterized by the identity of a terraform
4+
A *dynamically bridged provider* is a Pulumi provider parameterized by the identity of a terraform
55
provider. It consists of a binary `pulumi-terraform-bridge`, which is spun up as a provider by `pulumi`. The
66
binary is responsible for downloading the terraform provider it is emulating, then translating `pulumi`’s
77
[gRPC protocol](https://github.com/pulumi/pulumi/tree/master/proto/pulumi) into [Terraform’s v6
88
protocol](https://developer.hashicorp.com/terraform/plugin/terraform-plugin-protocol).
99

1010
## Usage
1111

12-
Dynamic bridged providers are a subset of parameterized providers <!-- TODO: Insert link to docs / blog post
13-
if/when it exists -->, so they are used via parameterization. If you are using a language besides Pulumi YAML,
14-
you start by generating an SDK.
12+
If you are using a language besides Pulumi YAML, you start by generating an SDK.
1513

1614
### SDK Generation
1715

@@ -56,7 +54,6 @@ so you won't need to enter any of this information again as long as you use the
5654

5755
#### Path based SDK generation
5856

59-
6057
To generate an SDK based on a Terraform provider on your local file system, use:
6158

6259
``` sh
@@ -99,7 +96,6 @@ sequenceDiagram
9996
Diving deeper into how the repo is laid out, we see:
10097

10198
``` console
102-
$ eza -T --classify=always -I 'test*' --git-ignore
10399
./
104100
├── go.mod
105101
├── go.sum
@@ -127,16 +123,16 @@ $ eza -T --classify=always -I 'test*' --git-ignore
127123
└── version.go
128124
```
129125

130-
The dynamic provider layer is by-design as simple and straight-forward as possible. Each package does one
131-
thing only and there isn't that much code. As of time of writing, the entire `dynamic` folder is only 2288
132-
lines of go code[^1]. I'll go through each package in turn.
126+
The dynamic provider layer consists by design of small, specialized packages.
127+
As of time of writing, the entire `dynamic` folder is only 2288 lines of go code[^1].
128+
Let's go through each package in turn.
133129

134130
[^1]: `loc --exclude '*._test.go'`
135131

136132
### `package main`
137133

138134
`package main` is responsible for launching a Pulumi provider and setting up the parameterize call. It does
139-
this by calling [`pf/tfbridge.Main`](https://pkg.go.dev/github.com/pulumi/pulumi-terraform-bridge/[email protected]/tfbridge#Main), passing in an empty PF provider (from
135+
this by calling [`pf/tfbridge.Main`](https://pkg.go.dev/github.com/pulumi/pulumi-terraform-bridge/[email protected]/tfbridge#Main), passing in an empty Terraform Plugin Framework provider (from
140136
[`pf/proto.Empty()`](https://pkg.go.dev/github.com/pulumi/pulumi-terraform-bridge/[email protected]/proto#Empty)). [`pf/tfbridge.ProviderMetadata`](https://pkg.go.dev/github.com/pulumi/pulumi-terraform-bridge/[email protected]/tfbridge#ProviderMetadata) allows overriding the `Parameterize` and
141137
`GetSchema` call (and we override both).
142138

@@ -146,7 +142,7 @@ functions return a [`tfprotov6.ProviderServer`](https://pkg.go.dev/github.com/ha
146142
[`pf/tfbridge.XParameterizeResetProvider`](https://pkg.go.dev/github.com/pulumi/pulumi-terraform-bridge/[email protected]/tfbridge#XParameterizeResetProvider).
147143

148144
When `GetSchema` is called, it generates a schema from the currently equipped provider with
149-
[`pkg/tfgen.GenerateSchemaWithOptions`](https://pkg.go.dev/github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfgen#GenerateSchemaWithOptions) and returns is. All type translation, documentation generation, etc
145+
[`pkg/tfgen.GenerateSchemaWithOptions`](https://pkg.go.dev/github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfgen#GenerateSchemaWithOptions) and returns it. All type translation, documentation generation, etc
150146
are done with standard bridge based functionality.
151147

152148
All other gRPC calls (`Create`, `Read`, `Update`, `Delete`, etc.) are handled normally by `pf`'s existing

0 commit comments

Comments
 (0)