Skip to content

Commit

Permalink
Add Cluster resource, tests, and examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
momer committed May 16, 2024
1 parent c7b0c71 commit c731d8e
Show file tree
Hide file tree
Showing 23 changed files with 1,960 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .task/checksum/docs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
531cc68ef20d0f9d3d2ab7dfe292438
acad9b55947f600d9c4d0d0416e13c19
109 changes: 109 additions & 0 deletions docs/data-sources/cluster.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "bonsai_cluster Data Source - terraform-provider-bonsai"
subcategory: ""
description: |-
Cluster represents a single cluster on your account.
---

# bonsai_cluster (Data Source)

Cluster represents a single cluster on your account.

## Example Usage

```terraform
data "bonsai_cluster" "get_by_slug" {
slug = "dcek-group-llc-5240651189"
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Optional

- `slug` (String) A unique, machine-readable name for the cluster. A cluster slug is based its name at creation, to which a random integer is concatenated.

### Read-Only

- `access` (Attributes) Access holds information about connecting to the cluster. (see [below for nested schema](#nestedatt--access))
- `name` (String) The human-readable name of the cluster.
- `plan` (Attributes) Plan holds some information about the cluster's current subscription plan. (see [below for nested schema](#nestedatt--plan))
- `release` (Attributes) Release holds some information about the cluster's current release. (see [below for nested schema](#nestedatt--release))
- `space` (Attributes) Space holds some information about where the cluster is running. (see [below for nested schema](#nestedatt--space))
- `state` (Attributes) State represents the current state of the cluster. This indicates what the cluster is doing at any given moment. (see [below for nested schema](#nestedatt--state))
- `stats` (Attributes) Stats holds *some* statistics about the cluster.

This attribute should not be used for real-time monitoring! Stats are updated every 10-15 minutes. To monitor real-time metrics, monitor your cluster directly, via the Index Stats API. (see [below for nested schema](#nestedatt--stats))
- `uri` (String) A URI to retrieve more information about this cluster.

<a id="nestedatt--access"></a>
### Nested Schema for `access`

Optional:

- `password` (String, Sensitive) Pass holds the password to access the cluster with.

Only shown once, during cluster creation.
- `user` (String, Sensitive) User holds the username to access the cluster with.

Only shown once, during cluster creation.

Read-Only:

- `host` (String) Host name of the cluster.
- `port` (Number) HTTP Port the cluster is running on.
- `scheme` (String) HTTP Scheme needed to access the cluster. Default: "https".
- `url` (String) URL is the Cluster endpoint for access.

Only shown once, during cluster creation.


<a id="nestedatt--plan"></a>
### Nested Schema for `plan`

Read-Only:

- `slug` (String) A machine-readable name for the plan.
- `uri` (String) A URI to retrieve more information about this Plan.


<a id="nestedatt--release"></a>
### Nested Schema for `release`

Read-Only:

- `package_name` (String) PackageName is the package name of the release.
- `service_type` (String) The service type of the deployment - for example, "elasticsearch".
- `slug` (String) The machine-readable name for the deployment.
- `uri` (String) A URI to retrieve more information about this Release.
- `version` (String) The version of the release.


<a id="nestedatt--space"></a>
### Nested Schema for `space`

Read-Only:

- `path` (String) A machine-readable name for the server group.
- `region` (String) The geographic region in which the cluster is running.
- `uri` (String) A URI to retrieve more information about this Space.


<a id="nestedatt--state"></a>
### Nested Schema for `state`

Read-Only:

- `state` (String) The state of the cluster.


<a id="nestedatt--stats"></a>
### Nested Schema for `stats`

Read-Only:

- `data_bytes_used` (Number) Number of bytes the cluster is using on-disk.
- `docs` (Number) Number of documents in the index.
- `shards_used` (Number) Number of shards the cluster is using.
114 changes: 114 additions & 0 deletions docs/data-sources/clusters.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "bonsai_clusters Data Source - terraform-provider-bonsai"
subcategory: ""
description: |-
A list of all active clusters on your account.
---

# bonsai_clusters (Data Source)

A list of all **active** clusters on your account.

## Example Usage

```terraform
data "bonsai_clusters" "list" {}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Read-Only

- `clusters` (Attributes List) Cluster represents a single cluster on your account. (see [below for nested schema](#nestedatt--clusters))

<a id="nestedatt--clusters"></a>
### Nested Schema for `clusters`

Optional:

- `slug` (String) A unique, machine-readable name for the cluster. A cluster slug is based its name at creation, to which a random integer is concatenated.

Read-Only:

- `access` (Attributes) Access holds information about connecting to the cluster. (see [below for nested schema](#nestedatt--clusters--access))
- `name` (String) The human-readable name of the cluster.
- `plan` (Attributes) Plan holds some information about the cluster's current subscription plan. (see [below for nested schema](#nestedatt--clusters--plan))
- `release` (Attributes) Release holds some information about the cluster's current release. (see [below for nested schema](#nestedatt--clusters--release))
- `space` (Attributes) Space holds some information about where the cluster is running. (see [below for nested schema](#nestedatt--clusters--space))
- `state` (Attributes) State represents the current state of the cluster. This indicates what the cluster is doing at any given moment. (see [below for nested schema](#nestedatt--clusters--state))
- `stats` (Attributes) Stats holds *some* statistics about the cluster.

This attribute should not be used for real-time monitoring! Stats are updated every 10-15 minutes. To monitor real-time metrics, monitor your cluster directly, via the Index Stats API. (see [below for nested schema](#nestedatt--clusters--stats))
- `uri` (String) A URI to retrieve more information about this cluster.

<a id="nestedatt--clusters--access"></a>
### Nested Schema for `clusters.access`

Optional:

- `password` (String, Sensitive) Pass holds the password to access the cluster with.

Only shown once, during cluster creation.
- `user` (String, Sensitive) User holds the username to access the cluster with.

Only shown once, during cluster creation.

Read-Only:

- `host` (String) Host name of the cluster.
- `port` (Number) HTTP Port the cluster is running on.
- `scheme` (String) HTTP Scheme needed to access the cluster. Default: "https".
- `url` (String) URL is the Cluster endpoint for access.

Only shown once, during cluster creation.


<a id="nestedatt--clusters--plan"></a>
### Nested Schema for `clusters.plan`

Read-Only:

- `slug` (String) A machine-readable name for the plan.
- `uri` (String) A URI to retrieve more information about this Plan.


<a id="nestedatt--clusters--release"></a>
### Nested Schema for `clusters.release`

Read-Only:

- `package_name` (String) PackageName is the package name of the release.
- `service_type` (String) The service type of the deployment - for example, "elasticsearch".
- `slug` (String) The machine-readable name for the deployment.
- `uri` (String) A URI to retrieve more information about this Release.
- `version` (String) The version of the release.


<a id="nestedatt--clusters--space"></a>
### Nested Schema for `clusters.space`

Read-Only:

- `path` (String) A machine-readable name for the server group.
- `region` (String) The geographic region in which the cluster is running.
- `uri` (String) A URI to retrieve more information about this Space.


<a id="nestedatt--clusters--state"></a>
### Nested Schema for `clusters.state`

Read-Only:

- `state` (String) The state of the cluster.


<a id="nestedatt--clusters--stats"></a>
### Nested Schema for `clusters.stats`

Read-Only:

- `data_bytes_used` (Number) Number of bytes the cluster is using on-disk.
- `docs` (Number) Number of documents in the index.
- `shards_used` (Number) Number of shards the cluster is using.
136 changes: 136 additions & 0 deletions docs/resources/cluster.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "bonsai_cluster Resource - terraform-provider-bonsai"
subcategory: ""
description: |-
Provides and manages a Cluster on your account.
---

# bonsai_cluster (Resource)

Provides and manages a Cluster on your account.

## Example Usage

```terraform
resource "bonsai_cluster" "test" {
name = "comped example"
plan = {
slug = "standard-nano-comped"
}
space = {
path = "omc/bonsai/us-east-1/common"
}
release = {
slug = "opensearch-2.6.0-mt"
}
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `name` (String) The human-readable name of the cluster.

### Optional

- `plan` (Attributes) Plan holds some information about the cluster's current subscription plan. (see [below for nested schema](#nestedatt--plan))
- `release` (Attributes) Release holds some information about the cluster's current release. (see [below for nested schema](#nestedatt--release))
- `space` (Attributes) Space holds some information about where the cluster is running. (see [below for nested schema](#nestedatt--space))

### Read-Only

- `access` (Attributes) Access holds information about connecting to the cluster. (see [below for nested schema](#nestedatt--access))
- `id` (String) The ID of this resource.
- `message` (String) Message received during Cluster creation
- `monitor` (String) Monitor received during Cluster creation
- `slug` (String) A unique, machine-readable name for the cluster. A cluster slug is based its name at creation, to which a random integer is concatenated.
- `state` (Attributes) State represents the current state of the cluster. This indicates what the cluster is doing at any given moment. (see [below for nested schema](#nestedatt--state))
- `stats` (Attributes) Stats holds *some* statistics about the cluster.

This attribute should not be used for real-time monitoring! Stats are updated every 10-15 minutes. To monitor real-time metrics, monitor your cluster directly, via the Index Stats API. (see [below for nested schema](#nestedatt--stats))
- `uri` (String) A URI to retrieve more information about this cluster.

<a id="nestedatt--plan"></a>
### Nested Schema for `plan`

Required:

- `slug` (String) A machine-readable name for the plan.

Read-Only:

- `uri` (String) A URI to retrieve more information about this Plan.


<a id="nestedatt--release"></a>
### Nested Schema for `release`

Optional:

- `slug` (String) The machine-readable name for the deployment.

Read-Only:

- `package_name` (String) PackageName is the package name of the release.
- `service_type` (String) The service type of the deployment - for example, "elasticsearch".
- `uri` (String) A URI to retrieve more information about this Release.
- `version` (String) The version of the release.


<a id="nestedatt--space"></a>
### Nested Schema for `space`

Optional:

- `path` (String) A machine-readable name for the server group.

Read-Only:

- `region` (String) The geographic region in which the cluster is running.
- `uri` (String) A URI to retrieve more information about this Space.


<a id="nestedatt--access"></a>
### Nested Schema for `access`

Optional:

- `password` (String, Sensitive) Pass holds the password to access the cluster with.

Only shown once, during cluster creation.
- `user` (String, Sensitive) User holds the username to access the cluster with.

Only shown once, during cluster creation.

Read-Only:

- `host` (String) Host name of the cluster.
- `port` (Number) HTTP Port the cluster is running on.
- `scheme` (String) HTTP Scheme needed to access the cluster. Default: "https".
- `url` (String) URL is the Cluster endpoint for access.

Only shown once, during cluster creation.


<a id="nestedatt--state"></a>
### Nested Schema for `state`

Read-Only:

- `state` (String) The state of the cluster.


<a id="nestedatt--stats"></a>
### Nested Schema for `stats`

Read-Only:

- `data_bytes_used` (Number) Number of bytes the cluster is using on-disk.
- `docs` (Number) Number of documents in the index.
- `shards_used` (Number) Number of shards the cluster is using.
Loading

0 comments on commit c731d8e

Please sign in to comment.