From 94de78fd8dbf5e26e8311273cd29b8db0cd72152 Mon Sep 17 00:00:00 2001 From: Edward Sun Date: Wed, 13 May 2020 14:58:12 +0000 Subject: [PATCH 1/3] add descriptions to the schema --- .../resources/resource_bigtable_instance.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/third_party/terraform/resources/resource_bigtable_instance.go b/third_party/terraform/resources/resource_bigtable_instance.go index ece530e46b58..db762237e605 100644 --- a/third_party/terraform/resources/resource_bigtable_instance.go +++ b/third_party/terraform/resources/resource_bigtable_instance.go @@ -45,21 +45,25 @@ func resourceBigtableInstance() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, + Description: `The name (also called Instance Id in the Cloud Console) of the Cloud Bigtable instance.`, }, "cluster": { Type: schema.TypeList, Optional: true, Computed: true, + Description: `A block of cluster configuration options. This can be specified 1 or 2 times.`, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "cluster_id": { Type: schema.TypeString, Required: true, + Description: `The ID of the Cloud Bigtable cluster.`, }, "zone": { Type: schema.TypeString, Required: true, + Description: `The zone to create the Cloud Bigtable cluster in. Each cluster must have a different zone in the same region. Zones that support Bigtable instances are noted on the Cloud Bigtable locations page.`, }, "num_nodes": { Type: schema.TypeInt, @@ -68,12 +72,14 @@ func resourceBigtableInstance() *schema.Resource { // so mark as computed. Computed: true, ValidateFunc: validation.IntAtLeast(1), + Description: `The number of nodes in your Cloud Bigtable cluster. Required, with a minimum of 1 for a PRODUCTION instance. Must be left unset for a DEVELOPMENT instance.`, }, "storage_type": { Type: schema.TypeString, Optional: true, Default: "SSD", ValidateFunc: validation.StringInSlice([]string{"SSD", "HDD"}, false), + Description: `The storage type to use. One of "SSD" or "HDD". Defaults to "SSD".`, }, }, }, @@ -82,6 +88,7 @@ func resourceBigtableInstance() *schema.Resource { Type: schema.TypeString, Optional: true, Computed: true, + Description: `The human-readable display name of the Bigtable instance. Defaults to the instance name.`, }, "instance_type": { @@ -89,12 +96,16 @@ func resourceBigtableInstance() *schema.Resource { Optional: true, Default: "PRODUCTION", ValidateFunc: validation.StringInSlice([]string{"DEVELOPMENT", "PRODUCTION"}, false), + Description: `The instance type to create. One of "DEVELOPMENT" or "PRODUCTION". Defaults to "PRODUCTION".`, }, "deletion_protection": { Type: schema.TypeBool, Optional: true, Default: true, + Description: `Whether or not to allow Terraform to destroy the instance. Unless this field is set to false in Terraform state, a terraform destroy or terraform apply that would delete the instance will fail. + +`, }, "project": { @@ -102,6 +113,7 @@ func resourceBigtableInstance() *schema.Resource { Optional: true, Computed: true, ForceNew: true, + Description: `The ID of the project in which the resource belongs. If it is not provided, the provider project is used.`, }, }, } From abd26fbd5b59fa60a06bb71a8aab26f4599deab5 Mon Sep 17 00:00:00 2001 From: Edward Sun Date: Wed, 13 May 2020 18:40:57 +0000 Subject: [PATCH 2/3] add descriptions to schema --- third_party/terraform/resources/resource_bigtable_instance.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/third_party/terraform/resources/resource_bigtable_instance.go b/third_party/terraform/resources/resource_bigtable_instance.go index db762237e605..34eb50738bb3 100644 --- a/third_party/terraform/resources/resource_bigtable_instance.go +++ b/third_party/terraform/resources/resource_bigtable_instance.go @@ -103,9 +103,7 @@ func resourceBigtableInstance() *schema.Resource { Type: schema.TypeBool, Optional: true, Default: true, - Description: `Whether or not to allow Terraform to destroy the instance. Unless this field is set to false in Terraform state, a terraform destroy or terraform apply that would delete the instance will fail. - -`, + Description: `Whether or not to allow Terraform to destroy the instance. Unless this field is set to false in Terraform state, a terraform destroy or terraform apply that would delete the instance will fail.`, }, "project": { From a96452befb14b54d77994af6f9d37f1c5c99dfd2 Mon Sep 17 00:00:00 2001 From: Edward Sun Date: Wed, 13 May 2020 19:05:20 +0000 Subject: [PATCH 3/3] run go fmt --- .../resources/resource_bigtable_instance.go | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/third_party/terraform/resources/resource_bigtable_instance.go b/third_party/terraform/resources/resource_bigtable_instance.go index 34eb50738bb3..c1fb475e12a8 100644 --- a/third_party/terraform/resources/resource_bigtable_instance.go +++ b/third_party/terraform/resources/resource_bigtable_instance.go @@ -42,27 +42,27 @@ func resourceBigtableInstance() *schema.Resource { // ---------------------------------------------------------------------- Schema: map[string]*schema.Schema{ "name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, + Type: schema.TypeString, + Required: true, + ForceNew: true, Description: `The name (also called Instance Id in the Cloud Console) of the Cloud Bigtable instance.`, }, "cluster": { - Type: schema.TypeList, - Optional: true, - Computed: true, + Type: schema.TypeList, + Optional: true, + Computed: true, Description: `A block of cluster configuration options. This can be specified 1 or 2 times.`, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "cluster_id": { - Type: schema.TypeString, - Required: true, + Type: schema.TypeString, + Required: true, Description: `The ID of the Cloud Bigtable cluster.`, }, "zone": { - Type: schema.TypeString, - Required: true, + Type: schema.TypeString, + Required: true, Description: `The zone to create the Cloud Bigtable cluster in. Each cluster must have a different zone in the same region. Zones that support Bigtable instances are noted on the Cloud Bigtable locations page.`, }, "num_nodes": { @@ -72,22 +72,22 @@ func resourceBigtableInstance() *schema.Resource { // so mark as computed. Computed: true, ValidateFunc: validation.IntAtLeast(1), - Description: `The number of nodes in your Cloud Bigtable cluster. Required, with a minimum of 1 for a PRODUCTION instance. Must be left unset for a DEVELOPMENT instance.`, + Description: `The number of nodes in your Cloud Bigtable cluster. Required, with a minimum of 1 for a PRODUCTION instance. Must be left unset for a DEVELOPMENT instance.`, }, "storage_type": { Type: schema.TypeString, Optional: true, Default: "SSD", ValidateFunc: validation.StringInSlice([]string{"SSD", "HDD"}, false), - Description: `The storage type to use. One of "SSD" or "HDD". Defaults to "SSD".`, + Description: `The storage type to use. One of "SSD" or "HDD". Defaults to "SSD".`, }, }, }, }, "display_name": { - Type: schema.TypeString, - Optional: true, - Computed: true, + Type: schema.TypeString, + Optional: true, + Computed: true, Description: `The human-readable display name of the Bigtable instance. Defaults to the instance name.`, }, @@ -96,21 +96,21 @@ func resourceBigtableInstance() *schema.Resource { Optional: true, Default: "PRODUCTION", ValidateFunc: validation.StringInSlice([]string{"DEVELOPMENT", "PRODUCTION"}, false), - Description: `The instance type to create. One of "DEVELOPMENT" or "PRODUCTION". Defaults to "PRODUCTION".`, + Description: `The instance type to create. One of "DEVELOPMENT" or "PRODUCTION". Defaults to "PRODUCTION".`, }, "deletion_protection": { - Type: schema.TypeBool, - Optional: true, - Default: true, + Type: schema.TypeBool, + Optional: true, + Default: true, Description: `Whether or not to allow Terraform to destroy the instance. Unless this field is set to false in Terraform state, a terraform destroy or terraform apply that would delete the instance will fail.`, }, "project": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, Description: `The ID of the project in which the resource belongs. If it is not provided, the provider project is used.`, }, },