Skip to content

Commit 7596164

Browse files
authored
Deprecate name_prefix (#1035)
* deprecate name_prefix * make name_prefix computed and add migration instructions
1 parent 78e8c7b commit 7596164

6 files changed

+12
-3
lines changed

google/resource_compute_instance_template.go

+3
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ func resourceComputeInstanceTemplate() *schema.Resource {
4040
"name_prefix": &schema.Schema{
4141
Type: schema.TypeString,
4242
Optional: true,
43+
Computed: true,
4344
ForceNew: true,
4445
ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) {
4546
// https://cloud.google.com/compute/docs/reference/latest/instanceTemplates#resource
@@ -51,6 +52,8 @@ func resourceComputeInstanceTemplate() *schema.Resource {
5152
}
5253
return
5354
},
55+
Deprecated: "Use the random provider instead. See migration instructions at " +
56+
"https://github.com/terraform-providers/terraform-provider-google/issues/1054#issuecomment-377390209",
5457
},
5558

5659
"disk": &schema.Schema{

google/resource_compute_ssl_certificate.go

+3
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ func resourceComputeSslCertificate() *schema.Resource {
3939
"name_prefix": &schema.Schema{
4040
Type: schema.TypeString,
4141
Optional: true,
42+
Computed: true,
4243
ForceNew: true,
4344
ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) {
4445
// https://cloud.google.com/compute/docs/reference/latest/sslCertificates#resource
@@ -50,6 +51,8 @@ func resourceComputeSslCertificate() *schema.Resource {
5051
}
5152
return
5253
},
54+
Deprecated: "Use the random provider instead. See migration instructions at " +
55+
"https://github.com/terraform-providers/terraform-provider-google/issues/1054#issuecomment-377390209",
5356
},
5457

5558
"private_key": &schema.Schema{

google/resource_container_node_pool.go

+3
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,10 @@ var schemaNodePool = map[string]*schema.Schema{
133133
"name_prefix": &schema.Schema{
134134
Type: schema.TypeString,
135135
Optional: true,
136+
Computed: true,
136137
ForceNew: true,
138+
Deprecated: "Use the random provider instead. See migration instructions at " +
139+
"https://github.com/terraform-providers/terraform-provider-google/issues/1054#issuecomment-377390209",
137140
},
138141

139142
"node_config": schemaNodeConfig,

website/docs/r/compute_instance_template.html.markdown

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ The following arguments are supported:
125125
* `name` - (Optional) The name of the instance template. If you leave
126126
this blank, Terraform will auto-generate a unique name.
127127

128-
* `name_prefix` - (Optional) Creates a unique name beginning with the specified
128+
* `name_prefix` - (Deprecated, Optional) Creates a unique name beginning with the specified
129129
prefix. Conflicts with `name`.
130130

131131
* `can_ip_forward` - (Optional) Whether to allow sending and receiving of

website/docs/r/compute_ssl_certificate.html.markdown

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ The following arguments are supported:
7070
* `name` - (Optional) A unique name for the SSL certificate. If you leave
7171
this blank, Terraform will auto-generate a unique name.
7272

73-
* `name_prefix` - (Optional) Creates a unique name beginning with the specified
73+
* `name_prefix` - (Deprecated, Optional) Creates a unique name beginning with the specified
7474
prefix. Conflicts with `name`.
7575

7676
* `description` - (Optional) An optional description of this resource.

website/docs/r/container_node_pool.html.markdown

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ resource "google_container_cluster" "primary" {
109109
* `name` - (Optional) The name of the node pool. If left blank, Terraform will
110110
auto-generate a unique name.
111111

112-
* `name_prefix` - (Optional) Creates a unique name for the node pool beginning
112+
* `name_prefix` - (Deprecated, Optional) Creates a unique name for the node pool beginning
113113
with the specified prefix. Conflicts with `name`.
114114

115115
* `node_config` - (Optional) The node configuration of the pool. See

0 commit comments

Comments
 (0)