Skip to content

Commit 3330482

Browse files
committed
Remove links to source code and make examples generic in migrating - attributes & blocks - blocks computed (#418)
1 parent fdc6d8f commit 3330482

File tree

1 file changed

+6
-16
lines changed

1 file changed

+6
-16
lines changed

website/docs/plugin/framework/migrating/attributes-blocks/blocks-computed.mdx

+6-16
Original file line numberDiff line numberDiff line change
@@ -73,28 +73,18 @@ map[string]schema.Attribute{
7373
7474
## Example
7575
76-
The following examples show how to migrate portions of the [tls](https://github.com/hashicorp/terraform-provider-tls)
77-
provider.
78-
79-
For a complete example, clone the
80-
`terraform-provider-tls` repository and compare the `data_source_certificate.go` file in
81-
[v3.4.0](https://github.com/hashicorp/terraform-provider-tls/blob/v3.4.0/internal/provider/data_source_certificate.go)
82-
with
83-
[v4.0.1](https://github.com/hashicorp/terraform-provider-tls/blob/v4.0.1/internal/provider/data_source_certificate.go).
84-
8576
### SDKv2
8677
87-
The following example from the `data_source_certificate.go` file shows the implementation of the `certificates` nested
88-
block on the `certificate` data source's schema.
78+
The following example shows the implementation of the `example_nested_block` with SDKv2.
8979
9080
```go
9181
Schema: map[string]*schema.Schema{
92-
"certificates": {
82+
"example_nested_block": {
9383
Type: schema.TypeList,
9484
Computed: true,
9585
Elem: &schema.Resource{
9686
Schema: map[string]*schema.Schema{
97-
"signature_algorithm": {
87+
"example_block_attribute": {
9888
Type: schema.TypeString,
9989
Computed: true,
10090
/* ... */
@@ -105,15 +95,15 @@ Schema: map[string]*schema.Schema{
10595
10696
The following shows the same section of provider code after the migration.
10797
108-
This code defines the `certificates` block as an attribute on the `certificate` data source's schema, where the
98+
This code defines the `example_nested_block` block as an attribute on the schema, where the
10999
`types.ObjectType` is being used to define the nested block.
110100
111101
```go
112102
map[string]schema.Attribute{
113-
"certificates": schema.ListAttribute{
103+
"example_nested_block": schema.ListAttribute{
114104
ElementType: types.ObjectType{
115105
AttrTypes: map[string]attr.Type{
116-
"signature_algorithm": types.StringType,
106+
"example_block_attribute": types.StringType,
117107
},
118108
},
119109
Computed: true,

0 commit comments

Comments
 (0)