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

[Terraform]: google_bigtable_instance add back validation to num_nodes. #679

Merged
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
2 changes: 1 addition & 1 deletion build/terraform
2 changes: 1 addition & 1 deletion build/terraform-beta
5 changes: 3 additions & 2 deletions provider/terraform/resources/resource_bigtable_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ func resourceBigtableInstance() *schema.Resource {
Required: true,
},
"num_nodes": {
Type: schema.TypeInt,
Optional: true,
Type: schema.TypeInt,
Optional: true,
ValidateFunc: validation.IntAtLeast(3),
},
"storage_type": {
Type: schema.TypeString,
Expand Down
22 changes: 19 additions & 3 deletions provider/terraform/website/docs/r/bigtable_instance.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ Creates a Google Bigtable instance. For more information see
[API](https://cloud.google.com/bigtable/docs/go/reference).


## Example Usage
## Example Usage - Production Instance

```hcl
resource "google_bigtable_instance" "instance" {
resource "google_bigtable_instance" "production-instance" {
name = "tf-instance"

cluster {
cluster_id = "tf-instance-cluster"
zone = "us-central1-b"
Expand All @@ -27,6 +28,21 @@ resource "google_bigtable_instance" "instance" {
}
```

## Example Usage - Development Instance

```hcl
resource "google_bigtable_instance" "development-instance" {
name = "tf-instance"
instance_type = "DEVELOPMENT"

cluster {
cluster_id = "tf-instance-cluster"
zone = "us-central1-b"
storage_type = "HDD"
}
}
```

## Argument Reference

The following arguments are supported:
Expand All @@ -53,7 +69,7 @@ The `cluster` block supports the following arguments:

* `zone` - (Required) 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](https://cloud.google.com/bigtable/docs/locations).

* `num_nodes` - (Optional) The number of nodes in your Cloud Bigtable cluster. Required, with a minimum of `3` for a `PRODUCTION` instance. Cannot be set for a `DEVELOPMENT` instance.
* `num_nodes` - (Optional) The number of nodes in your Cloud Bigtable cluster. Required, with a minimum of `3` for a `PRODUCTION` instance. Must be left unset for a `DEVELOPMENT` instance.

* `storage_type` - (Optional) The storage type to use. One of `"SSD"` or `"HDD"`. Defaults to `"SSD"`.

Expand Down