Deprecate name_prefix (#1035)

* deprecate name_prefix

* make name_prefix computed and add migration instructions
This commit is contained in:
Dana Hoffman 2018-04-02 10:28:59 -07:00 committed by GitHub
parent 78e8c7b378
commit 7596164ad1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 12 additions and 3 deletions

View File

@ -40,6 +40,7 @@ func resourceComputeInstanceTemplate() *schema.Resource {
"name_prefix": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Computed: true,
ForceNew: true,
ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) {
// https://cloud.google.com/compute/docs/reference/latest/instanceTemplates#resource
@ -51,6 +52,8 @@ func resourceComputeInstanceTemplate() *schema.Resource {
}
return
},
Deprecated: "Use the random provider instead. See migration instructions at " +
"https://github.com/terraform-providers/terraform-provider-google/issues/1054#issuecomment-377390209",
},
"disk": &schema.Schema{

View File

@ -39,6 +39,7 @@ func resourceComputeSslCertificate() *schema.Resource {
"name_prefix": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Computed: true,
ForceNew: true,
ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) {
// https://cloud.google.com/compute/docs/reference/latest/sslCertificates#resource
@ -50,6 +51,8 @@ func resourceComputeSslCertificate() *schema.Resource {
}
return
},
Deprecated: "Use the random provider instead. See migration instructions at " +
"https://github.com/terraform-providers/terraform-provider-google/issues/1054#issuecomment-377390209",
},
"private_key": &schema.Schema{

View File

@ -133,7 +133,10 @@ var schemaNodePool = map[string]*schema.Schema{
"name_prefix": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Computed: true,
ForceNew: true,
Deprecated: "Use the random provider instead. See migration instructions at " +
"https://github.com/terraform-providers/terraform-provider-google/issues/1054#issuecomment-377390209",
},
"node_config": schemaNodeConfig,

View File

@ -125,7 +125,7 @@ The following arguments are supported:
* `name` - (Optional) The name of the instance template. If you leave
this blank, Terraform will auto-generate a unique name.
* `name_prefix` - (Optional) Creates a unique name beginning with the specified
* `name_prefix` - (Deprecated, Optional) Creates a unique name beginning with the specified
prefix. Conflicts with `name`.
* `can_ip_forward` - (Optional) Whether to allow sending and receiving of

View File

@ -70,7 +70,7 @@ The following arguments are supported:
* `name` - (Optional) A unique name for the SSL certificate. If you leave
this blank, Terraform will auto-generate a unique name.
* `name_prefix` - (Optional) Creates a unique name beginning with the specified
* `name_prefix` - (Deprecated, Optional) Creates a unique name beginning with the specified
prefix. Conflicts with `name`.
* `description` - (Optional) An optional description of this resource.

View File

@ -109,7 +109,7 @@ resource "google_container_cluster" "primary" {
* `name` - (Optional) The name of the node pool. If left blank, Terraform will
auto-generate a unique name.
* `name_prefix` - (Optional) Creates a unique name for the node pool beginning
* `name_prefix` - (Deprecated, Optional) Creates a unique name for the node pool beginning
with the specified prefix. Conflicts with `name`.
* `node_config` - (Optional) The node configuration of the pool. See