Skip to content

Latest commit

 

History

History
168 lines (116 loc) · 6.8 KB

File metadata and controls

168 lines (116 loc) · 6.8 KB
page_title subcategory description
tidbcloud_clusters Data Source - terraform-provider-tidbcloud
clusters data source

tidbcloud_clusters (Data Source)

clusters data source

Example Usage

terraform {
  required_providers {
    tidbcloud = {
      source = "tidbcloud/tidbcloud"
    }
  }
}

provider "tidbcloud" {
  public_key  = "fake_public_key"
  private_key = "fake_private_key"
}

data "tidbcloud_clusters" "example" {
  project_id = "fake_id"
}

output "output" {
  value = data.tidbcloud_clusters.example
}

Schema

Required

  • project_id (String) The ID of the project

Optional

  • page (Number) Default:1 The number of pages.
  • page_size (Number) Default:10 The size of a pages.

Read-Only

  • id (String) data source ID.
  • items (Attributes List) The items of clusters in the project. (see below for nested schema)
  • total (Number) The total number of project clusters.

Nested Schema for items

Read-Only:

  • cloud_provider (String) Enum: "AWS" "GCP", The cloud provider on which your TiDB cluster is hosted.
  • cluster_type (String) The cluster type.
  • config (Attributes) The configuration of the cluster. (see below for nested schema)
  • create_timestamp (String) The creation time of the cluster in Unix timestamp seconds (epoch time).
  • id (String) The ID of the cluster.
  • name (String) The name of the cluster.
  • project_id (String) The ID of the project.
  • region (String) Region of the cluster.
  • status (Attributes) The status of the cluster. (see below for nested schema)

Nested Schema for items.config

Read-Only:

  • components (Attributes) The components of the cluster. (see below for nested schema)
  • port (Number) The TiDB port for connection. The port must be in the range of 1024-65535 except 10080, 4000 in default.
    • For a Serverless Tier cluster, only port 4000 is available.

Nested Schema for items.config.components

Optional:

Read-Only:

Nested Schema for items.config.components.tiflash

Read-Only:

  • node_quantity (Number) The number of nodes in the cluster. You can get the minimum and step of a node quantity from the tidbcloud_cluster_specs datasource.
    • TiFlash do not support decreasing node quantity.
  • node_size (String) The size of the TiFlash component in the cluster, You can get the available node size of each region from the tidbcloud_cluster_specs datasource.
    • Can not modify node_size of an existing cluster.
  • storage_size_gib (Number) The storage size of a node in the cluster. You can get the minimum and maximum of storage size from the tidbcloud_cluster_specs datasource.
    • Can not modify storage_size_gib of an existing cluster.

Nested Schema for items.config.components.tidb

Read-Only:

  • node_quantity (Number) The number of nodes in the cluster. You can get the minimum and step of a node quantity from the tidbcloud_cluster_specs datasource.
  • node_size (String) The size of the TiDB component in the cluster, You can get the available node size of each region from the tidbcloud_cluster_specs datasource.
    • If the vCPUs of TiDB or TiKV component is 2 or 4, then their vCPUs need to be the same.
    • If the vCPUs of TiDB or TiKV component is 2 or 4, then the cluster does not support TiFlash.
    • Can not modify node_size of an existing cluster.

Nested Schema for items.config.components.tikv

Read-Only:

  • node_quantity (Number) The number of nodes in the cluster. You can get the minimum and step of a node quantity from the tidbcloud_cluster_specs datasource.
    • TiKV do not support decreasing node quantity.
    • The node_quantity of TiKV must be a multiple of 3.
  • node_size (String) The size of the TiKV component in the cluster, You can get the available node size of each region from the tidbcloud_cluster_specs datasource.
    • If the vCPUs of TiDB or TiKV component is 2 or 4, then their vCPUs need to be the same.
    • If the vCPUs of TiDB or TiKV component is 2 or 4, then the cluster does not support TiFlash.
    • Can not modify node_size of an existing cluster.
  • storage_size_gib (Number) The storage size of a node in the cluster. You can get the minimum and maximum of storage size from the tidbcloud_cluster_specs datasource.
    • Can not modify storage_size_gib of an existing cluster.

Nested Schema for items.status

Read-Only:

  • cluster_status (String) Status of the cluster.
  • connection_strings (Attributes) Connection strings. (see below for nested schema)
  • tidb_version (String) TiDB version.

Nested Schema for items.status.connection_strings

Read-Only:

Nested Schema for items.status.connection_strings.standard

Read-Only:

  • host (String) The host of standard connection.
  • port (Number) The TiDB port for connection. The port must be in the range of 1024-65535 except 10080.

Nested Schema for items.status.connection_strings.vpc_peering

Read-Only:

  • host (String) The host of VPC peering connection.
  • port (Number) The TiDB port for connection. The port must be in the range of 1024-65535 except 10080.