Fix google_container_cluster docs about fields gone GA (#2597)

<!-- This change is generated by MagicModules. -->
/cc @rileykarson
This commit is contained in:
The Magician 2018-12-06 09:38:38 -08:00 committed by Nathan McKinley
parent 3a287fa3a3
commit c6f02a1e88
3 changed files with 18 additions and 8 deletions

View File

@ -34,20 +34,24 @@ func resourceBigtableInstance() *schema.Resource {
"cluster_id": { "cluster_id": {
Type: schema.TypeString, Type: schema.TypeString,
Required: true, Required: true,
ForceNew: true,
}, },
"zone": { "zone": {
Type: schema.TypeString, Type: schema.TypeString,
Required: true, Required: true,
ForceNew: true,
}, },
"num_nodes": { "num_nodes": {
Type: schema.TypeInt, Type: schema.TypeInt,
Optional: true, Optional: true,
ForceNew: true,
ValidateFunc: validation.IntAtLeast(3), ValidateFunc: validation.IntAtLeast(3),
}, },
"storage_type": { "storage_type": {
Type: schema.TypeString, Type: schema.TypeString,
Optional: true, Optional: true,
Default: "SSD", Default: "SSD",
ForceNew: true,
ValidateFunc: validation.StringInSlice([]string{"SSD", "HDD"}, false), ValidateFunc: validation.StringInSlice([]string{"SSD", "HDD"}, false),
}, },
}, },

View File

@ -21,7 +21,14 @@ func TestAccBigtableInstance_basic(t *testing.T) {
CheckDestroy: testAccCheckBigtableInstanceDestroy, CheckDestroy: testAccCheckBigtableInstanceDestroy,
Steps: []resource.TestStep{ 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( Check: resource.ComposeTestCheckFunc(
testAccBigtableInstanceExists( testAccBigtableInstanceExists(
"google_bigtable_instance.instance"), "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(` return fmt.Sprintf(`
resource "google_bigtable_instance" "instance" { resource "google_bigtable_instance" "instance" {
name = "%s" name = "%s"
cluster { cluster {
cluster_id = "%s" cluster_id = "%s"
zone = "us-central1-b" zone = "us-central1-b"
num_nodes = 3 num_nodes = %d
storage_type = "HDD" storage_type = "HDD"
} }
} }
`, instanceName, instanceName) `, instanceName, instanceName, numNodes)
} }
func testAccBigtableInstance_cluster(instanceName string) string { func testAccBigtableInstance_cluster(instanceName string) string {

View File

@ -75,7 +75,7 @@ output "cluster_ca_certificate" {
in `initial_node_count` should be created in. Only one of `zone` and `region` 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. 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 The region to create the cluster in, for
[Regional Clusters](https://cloud.google.com/kubernetes-engine/docs/concepts/multi-zone-and-regional-clusters#regional). [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 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. [PodSecurityPolicy](https://cloud.google.com/kubernetes-engine/docs/how-to/pod-security-policies) feature.
Structure is documented below. 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. a private cluster. Structure is documented below.
* `project` - (Optional) The ID of the project in which the resource belongs. If it * `project` - (Optional) The ID of the project in which the resource belongs. If it
@ -473,8 +473,7 @@ exported:
## Import ## Import
GKE clusters can be imported using the `project` , `zone` or `region` (`region` GKE clusters can be imported using the `project` , `zone` or `region`, and `name`. If the project is omitted, the default
is deprecated, see above), and `name`. If the project is omitted, the default
provider value will be used. Examples: provider value will be used. Examples:
``` ```