Skip to content

Latest commit

 

History

History
161 lines (119 loc) · 6.77 KB

File metadata and controls

161 lines (119 loc) · 6.77 KB
page_title subcategory description
tidbcloud_restore Resource - terraform-provider-tidbcloud
restore resource

tidbcloud_restore (Resource)

restore resource

Example Usage

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

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

resource "tidbcloud_restore" "example" {
  project_id = "fake_id"
  backup_id  = "fake_id"
  name       = "example"
  config = {
    root_password = "Fake_root_password1"
    port          = 4000
    components = {
      tidb = {
        node_size : "8C16G"
        node_quantity : 1
      }
      tikv = {
        node_size : "8C32G"
        storage_size_gib : 500
        node_quantity : 3
      }
      tiflash = {
        node_size : "8C64G"
        storage_size_gib : 2048
        node_quantity : 2
      }
    }
  }
}

Schema

Required

  • backup_id (String) The ID of the backup
  • config (Attributes) The configuration of the cluster (see below for nested schema)
  • name (String) The name of the restore
  • project_id (String) The ID of the project. You can get the project ID from tidbcloud_projects datasource.

Read-Only

  • cluster (Attributes) The information of the restored cluster. The restored cluster is the new cluster your backup data is restored to. (see below for nested schema)
  • cluster_id (String) The ID of the cluster
  • create_timestamp (String) The creation time of the backup in UTC.The time format follows the ISO8601 standard, which is YYYY-MM-DD (year-month-day) + T +HH:MM:SS (hour-minutes-seconds) + Z. For example, 2020-01-01T00:00:00Z.
  • error_message (String) The error message of restore if failed.
  • id (String) The ID of the restore
  • status (String) Enum: "PENDING" "RUNNING" "FAILED" "SUCCESS" The status of the restore task.

Nested Schema for config

Required:

  • components (Attributes) The components of the cluster.
    • For a Serverless Tier cluster, the components value can not be set. - For a Dedicated Tier cluster, the components value must be set. (see below for nested schema)
  • root_password (String) The root password to access the cluster. It must be 8-64 characters.

Optional:

  • ip_access_list (Attributes List) A list of IP addresses and Classless Inter-Domain Routing (CIDR) addresses that are allowed to access the TiDB Cloud cluster via standard connection. (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 config.components

Required:

Optional:

Nested Schema for config.components.tidb

Required:

  • 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 config.components.tikv

Required:

  • 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 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 config.components.tiflash

Required:

  • 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 TiFlash 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 config.ip_access_list

Required:

  • cidr (String) The IP address or CIDR range that you want to add to the cluster's IP access list.
  • description (String) Description that explains the purpose of the entry.

Nested Schema for cluster

Read-Only:

  • id (String) The ID of the restored cluster. The restored cluster is the new cluster your backup data is restored to.
  • name (String) The name of the restored cluster. The restored cluster is the new cluster your backup data is restored to.
  • status (String) The status of the restored cluster. Possible values are "AVAILABLE", "CREATING", "MODIFYING", "PAUSED", "RESUMING","UNAVAILABLE", "IMPORTING" and "CLEARED".