Skip to content

Commit

Permalink
Add descriptions to schema #1 (#3507)
Browse files Browse the repository at this point in the history
* add descriptions to the schema

* add descriptions to schema

* run go fmt

Co-authored-by: Edward Sun <[email protected]>
  • Loading branch information
edwardmedia and Edward Sun authored May 15, 2020
1 parent 1ba53cf commit 8951f33
Showing 1 changed file with 30 additions and 20 deletions.
50 changes: 30 additions & 20 deletions third_party/terraform/resources/resource_bigtable_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -68,40 +72,46 @@ 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": {
Type: schema.TypeString,
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.`,
},
},
}
Expand Down

0 comments on commit 8951f33

Please sign in to comment.