Skip to content

Commit 6fa7ab3

Browse files
Removed unused required: true from two resources' name fields to make sure it's clear that these fields are not required (#13698) (#22415)
[upstream:728992c72ec6db6f40ee034695a10de6c20a73cc] Signed-off-by: Modular Magician <[email protected]>
1 parent c5ac211 commit 6fa7ab3

File tree

4 files changed

+31
-31
lines changed

4 files changed

+31
-31
lines changed

google/services/spanner/resource_spanner_instance.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -134,17 +134,6 @@ In order to obtain a valid list please consult the
134134
Required: true,
135135
Description: `The descriptive name for this instance as it appears in UIs. Must be
136136
unique per project and between 4 and 30 characters in length.`,
137-
},
138-
"name": {
139-
Type: schema.TypeString,
140-
Computed: true,
141-
Optional: true,
142-
ForceNew: true,
143-
ValidateFunc: verify.ValidateRegexp(`^[a-z][-a-z0-9]*[a-z0-9]$`),
144-
Description: `A unique identifier for the instance, which cannot be changed after
145-
the instance is created. The name must be between 6 and 30 characters
146-
in length.
147-
If not provided, a random string starting with 'tf-' will be selected.`,
148137
},
149138
"autoscaling_config": {
150139
Type: schema.TypeList,
@@ -312,6 +301,17 @@ Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.
312301
Please refer to the field 'effective_labels' for all of the labels present on the resource.`,
313302
Elem: &schema.Schema{Type: schema.TypeString},
314303
},
304+
"name": {
305+
Type: schema.TypeString,
306+
Computed: true,
307+
Optional: true,
308+
ForceNew: true,
309+
ValidateFunc: verify.ValidateRegexp(`^[a-z][-a-z0-9]*[a-z0-9]$`),
310+
Description: `A unique identifier for the instance, which cannot be changed after
311+
the instance is created. The name must be between 6 and 30 characters
312+
in length.
313+
If not provided, a random string starting with 'tf-' will be selected.`,
314+
},
315315
"num_nodes": {
316316
Type: schema.TypeInt,
317317
Computed: true,

google/services/spanner/resource_spanner_instance_config.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,6 @@ func ResourceSpannerInstanceConfig() *schema.Resource {
109109
Required: true,
110110
Description: `The name of this instance configuration as it appears in UIs.`,
111111
},
112-
"name": {
113-
Type: schema.TypeString,
114-
Computed: true,
115-
Optional: true,
116-
ForceNew: true,
117-
Description: `A unique identifier for the instance configuration. Values are of the
118-
form projects/<project>/instanceConfigs/[a-z][-a-z0-9]*`,
119-
},
120112
"replicas": {
121113
Type: schema.TypeSet,
122114
Required: true,
@@ -145,6 +137,14 @@ Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.
145137
Please refer to the field 'effective_labels' for all of the labels present on the resource.`,
146138
Elem: &schema.Schema{Type: schema.TypeString},
147139
},
140+
"name": {
141+
Type: schema.TypeString,
142+
Computed: true,
143+
Optional: true,
144+
ForceNew: true,
145+
Description: `A unique identifier for the instance configuration. Values are of the
146+
form projects/<project>/instanceConfigs/[a-z][-a-z0-9]*`,
147+
},
148148
"config_type": {
149149
Type: schema.TypeString,
150150
Computed: true,

website/docs/r/spanner_instance.html.markdown

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,6 @@ resource "google_spanner_instance" "example" {
9494
The following arguments are supported:
9595

9696

97-
* `name` -
98-
(Required)
99-
A unique identifier for the instance, which cannot be changed after
100-
the instance is created. The name must be between 6 and 30 characters
101-
in length.
102-
If not provided, a random string starting with `tf-` will be selected.
103-
10497
* `config` -
10598
(Required)
10699
The name of the instance's configuration (similar but not
@@ -119,6 +112,13 @@ The following arguments are supported:
119112
- - -
120113

121114

115+
* `name` -
116+
(Optional)
117+
A unique identifier for the instance, which cannot be changed after
118+
the instance is created. The name must be between 6 and 30 characters
119+
in length.
120+
If not provided, a random string starting with `tf-` will be selected.
121+
122122
* `num_nodes` -
123123
(Optional)
124124
The number of nodes allocated to this instance. Exactly one of either node_count or processing_units

website/docs/r/spanner_instance_config.html.markdown

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,6 @@ resource "google_spanner_instance_config" "example" {
6060
The following arguments are supported:
6161

6262

63-
* `name` -
64-
(Required)
65-
A unique identifier for the instance configuration. Values are of the
66-
form projects/<project>/instanceConfigs/[a-z][-a-z0-9]*
67-
6863
* `display_name` -
6964
(Required)
7065
The name of this instance configuration as it appears in UIs.
@@ -96,6 +91,11 @@ The following arguments are supported:
9691
- - -
9792

9893

94+
* `name` -
95+
(Optional)
96+
A unique identifier for the instance configuration. Values are of the
97+
form projects/<project>/instanceConfigs/[a-z][-a-z0-9]*
98+
9999
* `base_config` -
100100
(Optional)
101101
Base configuration name, e.g. nam3, based on which this configuration is created.

0 commit comments

Comments
 (0)