You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
clone the `terraform-provider-tls` repository and compare the `resource_private_key.go` file in
153
-
[v3.4.0](https://github.com/hashicorp/terraform-provider-tls/blob/v3.4.0/internal/provider/resource_private_key.go) with the file
154
-
[after the migration](https://github.com/hashicorp/terraform-provider-tls/blob/4dafb105818e45a88532f917e7b170ee2a9bb092/internal/provider/resource_private_key.go).
155
-
156
148
### SDKv2
157
149
158
150
In SDKv2, the `ResourcesMap` field on the `schema.Provider` struct holds a `map[string]*schemaResource`. A typical
159
151
pattern is to implement a function that returns `schema.Resource`.
160
152
161
-
The following example from the `provider.go` file defines a `tls_private_key` resource within the provider schema.
162
-
163
153
```go
164
154
funcNew() (*schema.Provider, error) {
165
155
return &schema.Provider {
166
156
ResourcesMap: map[string]*schema.Resource {
167
-
"tls_private_key": resourcePrivateKey(),
157
+
"example_resource": exampleResource(),
168
158
/* ... */
169
159
```
170
160
171
-
The following example from the `resource_private_key.go` file defines the resource schema.
161
+
This code defines the `example_resource` resource by mapping the resource name to the `exampleResource` struct.
0 commit comments