@@ -75,39 +75,28 @@ func (r *ThingResource) Schema(ctx context.Context, req resource.SchemaRequest,
75
75
/* ... */
76
76
` ` `
77
77
78
-
79
78
## Example
80
79
81
- The following examples show how to migrate portions of the [tls](https://github.com/hashicorp/terraform-provider-tls)
82
- provider.
83
-
84
- For a complete example, clone the
85
- ` terraform-provider-tls` repository and compare the ` common_cert.go ` file in
86
- [v3.4.0](https://github.com/hashicorp/terraform-provider-tls/blob/v3.4.0/internal/provider/common_cert.go)
87
- with the ` resource_cert_request.go ` file in
88
- [v4.0.1](https://github.com/hashicorp/terraform-provider-tls/blob/v4.0.1/internal/provider/resource_cert_request.go).
89
-
90
80
### SDKv2
91
81
92
- The following example from the ` common_cert.go ` file shows the implementation of the ` subject` nested block on the
93
- ` cert_request` resource's schema with SDKv2.
82
+ The following example shows the implementation of the ` example_nested_block` nested block with SDKv2.
94
83
95
84
` ` ` go
96
85
map [string ]*schema.Schema {
97
- " private_key_pem " : &schema.Schema {
86
+ " example_attribute " : &schema.Schema {
98
87
Type: schema.TypeString ,
99
88
/* ... */
100
89
101
- " subject " = &schema.Schema {
90
+ " example_nested_block " = &schema.Schema {
102
91
Type: schema.TypeList ,
103
92
MaxItems: 1 ,
104
93
Elem: &schema.Resource {
105
94
Schema: map [string ]*schema.Schema {
106
- " organization " : {
95
+ " example_block_attribute_one " : {
107
96
Type: schema.TypeString ,
108
97
/* ... */
109
98
},
110
- " common_name " : {
99
+ " example_block_attribute_two " : {
111
100
Type: schema.TypeString ,
112
101
/* ... */
113
102
},
@@ -116,23 +105,23 @@ map[string]*schema.Schema{
116
105
117
106
### Framework
118
107
119
- The following example from the ` resource_cert_request. go ` file shows how the nested ` subject ` block on the
120
- ` cert_request ` resource is defined with the Framework after the migration.
108
+ The following example shows how the nested ` example_nested_block ` block
109
+ is defined with the Framework after the migration.
121
110
122
111
` ` ` go
123
112
schema.Schema {
124
113
Attributes: map [string ]schema.Attribute {
125
- " private_key_pem " : schema.StringAttribute {
114
+ " example_attribute " : schema.StringAttribute {
126
115
/* ... */
127
116
128
117
Blocks: map [string ]schema.Block {
129
- " subject " : schema.ListNestedBlock {
118
+ " example_nested_block " : schema.ListNestedBlock {
130
119
NestedObject: schema.NestedBlockObject {
131
120
Attributes: map [string ]schema.Attribute {
132
- " organization " : schema.StringAttribute {
121
+ " example_block_attribute_one " : schema.StringAttribute {
133
122
/* ... */
134
123
},
135
- " common_name " : schema.StringAttribute {
124
+ " example_block_attribute_two " : schema.StringAttribute {
136
125
/* ... */
137
126
},
138
127
Validators: validator.List {
0 commit comments