-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v0.2.0: Refactor cluster resources (#38)
* v0.2.0: Refactor cluster resources - Consolidated create specs and update specs into configs - Added some basic validation to Create and Update - Updated and pruned examples - Reran `go generate` to format examples and update docs - Bumped version to 0.2.0 - Removed problematic wait_for_cluster_ready flag - Simplified the schema for the cluster data source * fixed cluster region sort Regions in the cluster response are now sorted according to the order they show up in the plan. If a cluster doesn't show up in the plan, its ordinal defaults to 0 and it shows up first in the output, where Terraform will rightfully complain. * Fixed namespace for local provider resolution * test cluster name updates * bug fixes * updated doc generator and reran
- Loading branch information
1 parent
3f75d67
commit 167d18e
Showing
26 changed files
with
610 additions
and
821 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1 @@ | ||
_Add a description of the problem this PR addresses and an overview of how this PR works_. | ||
|
||
**Checklist** | ||
|
||
* [ ] I have added these changes to the changelog (or it's not applicable). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,7 @@ | ||
variable cluster_id { | ||
type = string | ||
} | ||
|
||
variable cloud_provider { | ||
variable "cluster_id" { | ||
type = string | ||
} | ||
|
||
data "cockroach_cluster" "cockroach" { | ||
id = var.cluster_id | ||
cloud_provider = var.cloud_provider | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
provider "cockroach" { | ||
# Instructions for using the CockroachDB Cloud API | ||
# https://www.cockroachlabs.com/docs/cockroachcloud/cloud-api.html | ||
# | ||
# Instructions for getting an API Key | ||
# https://www.cockroachlabs.com/docs/cockroachcloud/console-access-management#api-access | ||
# | ||
# The Terraform provider requires an environment variable COCKROACH_API_KEY | ||
# export COCKROACH_API_KEY="the API Key value here" | ||
# Instructions for using the CockroachDB Cloud API | ||
# https://www.cockroachlabs.com/docs/cockroachcloud/cloud-api.html | ||
# | ||
# Instructions for getting an API Key | ||
# https://www.cockroachlabs.com/docs/cockroachcloud/console-access-management#api-access | ||
# | ||
# The Terraform provider requires an environment variable COCKROACH_API_KEY | ||
# export COCKROACH_API_KEY="the API Key value here" | ||
} |
25 changes: 11 additions & 14 deletions
25
examples/resources/cockroach_dedicated_cluster/cockroach_dedicated_cluster.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,14 @@ | ||
resource "cockroach_cluster" "cockroach" { | ||
name = "cockroach-dedicated" | ||
cloud_provider = "GCP" | ||
create_spec = { | ||
dedicated: { | ||
region_nodes = { | ||
"us-central1": 1 | ||
} | ||
hardware = { | ||
storage_gib = 15 | ||
machine_spec = { | ||
machine_type = "n1-standard-4" | ||
} | ||
} | ||
name = "cockroach-dedicated" | ||
cloud_provider = "GCP" | ||
dedicated = { | ||
storage_gib = 15 | ||
machine_type = "n1-standard-4" | ||
} | ||
regions = [ | ||
{ | ||
name = "us-central1" | ||
node_count = 1 | ||
} | ||
} | ||
] | ||
} |
Oops, something went wrong.