From 8951f335375999ea0f494ed36f59a77ee2c1aff4 Mon Sep 17 00:00:00 2001 From: Edward Sun <42220489+edwardmedia@users.noreply.github.com> Date: Fri, 15 May 2020 16:28:45 -0700 Subject: [PATCH] Add descriptions to schema #1 (#3507) * add descriptions to the schema * add descriptions to schema * run go fmt Co-authored-by: Edward Sun --- .../resources/resource_bigtable_instance.go | 50 +++++++++++-------- 1 file changed, 30 insertions(+), 20 deletions(-) diff --git a/third_party/terraform/resources/resource_bigtable_instance.go b/third_party/terraform/resources/resource_bigtable_instance.go index ece530e46b58..c1fb475e12a8 100644 --- a/third_party/terraform/resources/resource_bigtable_instance.go +++ b/third_party/terraform/resources/resource_bigtable_instance.go @@ -42,24 +42,28 @@ 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": { Type: schema.TypeInt, @@ -68,20 +72,23 @@ 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".`, }, }, }, }, "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.`, }, "instance_type": { @@ -89,19 +96,22 @@ 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, + 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.`, }, }, }