Skip to content

Commit

Permalink
Fix google_container_cluster docs about fields gone GA (#2597)
Browse files Browse the repository at this point in the history
<!-- This change is generated by MagicModules. -->
/cc @rileykarson
  • Loading branch information
modular-magician authored and paddycarver committed Dec 14, 2018
1 parent 97ed4fc commit 99cb099
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
4 changes: 4 additions & 0 deletions google/resource_bigtable_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
},
},
Expand Down
15 changes: 11 additions & 4 deletions google/resource_bigtable_instance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down Expand Up @@ -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 {
Expand Down
7 changes: 3 additions & 4 deletions website/docs/r/container_cluster.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:

```
Expand Down

0 comments on commit 99cb099

Please sign in to comment.