From 99cb0991e2bf38c081c56d55a7c2b4e132cd14ec Mon Sep 17 00:00:00 2001 From: The Magician Date: Thu, 6 Dec 2018 09:38:38 -0800 Subject: [PATCH] Fix google_container_cluster docs about fields gone GA (#2597) /cc @rileykarson --- google/resource_bigtable_instance.go | 4 ++++ google/resource_bigtable_instance_test.go | 15 +++++++++++---- website/docs/r/container_cluster.html.markdown | 7 +++---- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/google/resource_bigtable_instance.go b/google/resource_bigtable_instance.go index aa020815b57..0a09c1728ed 100644 --- a/google/resource_bigtable_instance.go +++ b/google/resource_bigtable_instance.go @@ -34,20 +34,24 @@ func resourceBigtableInstance() *schema.Resource { "cluster_id": { Type: schema.TypeString, Required: true, + ForceNew: true, }, "zone": { Type: schema.TypeString, Required: true, + ForceNew: true, }, "num_nodes": { Type: schema.TypeInt, Optional: true, + ForceNew: true, ValidateFunc: validation.IntAtLeast(3), }, "storage_type": { Type: schema.TypeString, Optional: true, Default: "SSD", + ForceNew: true, ValidateFunc: validation.StringInSlice([]string{"SSD", "HDD"}, false), }, }, diff --git a/google/resource_bigtable_instance_test.go b/google/resource_bigtable_instance_test.go index a00189d3af7..cf878307a33 100644 --- a/google/resource_bigtable_instance_test.go +++ b/google/resource_bigtable_instance_test.go @@ -21,7 +21,14 @@ func TestAccBigtableInstance_basic(t *testing.T) { CheckDestroy: testAccCheckBigtableInstanceDestroy, Steps: []resource.TestStep{ { - Config: testAccBigtableInstance(instanceName), + Config: testAccBigtableInstance(instanceName, 3), + Check: resource.ComposeTestCheckFunc( + testAccBigtableInstanceExists( + "google_bigtable_instance.instance"), + ), + }, + { + Config: testAccBigtableInstance(instanceName, 4), Check: resource.ComposeTestCheckFunc( testAccBigtableInstanceExists( "google_bigtable_instance.instance"), @@ -125,18 +132,18 @@ func testAccBigtableInstanceExists(n string) resource.TestCheckFunc { } } -func testAccBigtableInstance(instanceName string) string { +func testAccBigtableInstance(instanceName string, numNodes int) string { return fmt.Sprintf(` resource "google_bigtable_instance" "instance" { name = "%s" cluster { cluster_id = "%s" zone = "us-central1-b" - num_nodes = 3 + num_nodes = %d storage_type = "HDD" } } -`, instanceName, instanceName) +`, instanceName, instanceName, numNodes) } func testAccBigtableInstance_cluster(instanceName string) string { diff --git a/website/docs/r/container_cluster.html.markdown b/website/docs/r/container_cluster.html.markdown index a0f81bbb993..07bd79efc32 100644 --- a/website/docs/r/container_cluster.html.markdown +++ b/website/docs/r/container_cluster.html.markdown @@ -75,7 +75,7 @@ output "cluster_ca_certificate" { in `initial_node_count` should be created in. Only one of `zone` and `region` may be set. If neither zone nor region are set, the provider zone is used. -* `region` (Optional, [Beta](https://terraform.io/docs/providers/google/provider_versions.html)) +* `region` (Optional) The region to create the cluster in, for [Regional Clusters](https://cloud.google.com/kubernetes-engine/docs/concepts/multi-zone-and-regional-clusters#regional). In a Regional Cluster, the number of nodes specified in `initial_node_count` is @@ -182,7 +182,7 @@ to the datasource. A `region` can have a different set of supported versions tha [PodSecurityPolicy](https://cloud.google.com/kubernetes-engine/docs/how-to/pod-security-policies) feature. Structure is documented below. -* `private_cluster_config` - (Optional, [Beta](https://terraform.io/docs/providers/google/provider_versions.html)) A set of options for creating +* `private_cluster_config` - (Optional) A set of options for creating a private cluster. Structure is documented below. * `project` - (Optional) The ID of the project in which the resource belongs. If it @@ -473,8 +473,7 @@ exported: ## Import -GKE clusters can be imported using the `project` , `zone` or `region` (`region` -is deprecated, see above), and `name`. If the project is omitted, the default +GKE clusters can be imported using the `project` , `zone` or `region`, and `name`. If the project is omitted, the default provider value will be used. Examples: ```