Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix google_container_cluster docs about fields gone GA #2597

Merged
merged 1 commit into from
Dec 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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