{"id":21846566,"url":"https://github.com/tidbcloud/terraform-provider-tidbcloud","last_synced_at":"2025-04-14T13:23:07.751Z","repository":{"id":57792054,"uuid":"527866175","full_name":"tidbcloud/terraform-provider-tidbcloud","owner":"tidbcloud","description":"Terraform TiDB Cloud Provider: Manage TiDB Cloud configurations as code through HashiCorp Terraform","archived":false,"fork":false,"pushed_at":"2025-03-25T03:33:13.000Z","size":647,"stargazers_count":7,"open_issues_count":12,"forks_count":3,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-03-28T02:38:46.611Z","etag":null,"topics":["terraform","terraform-provider","tidb","tidbcloud","tidbcloud-provider"],"latest_commit_sha":null,"homepage":"https://tidb.cloud/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tidbcloud.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-08-23T06:45:28.000Z","updated_at":"2025-03-25T03:33:16.000Z","dependencies_parsed_at":"2023-02-18T07:31:17.729Z","dependency_job_id":"3aec5cf8-b087-47b7-b4e7-e03ee31cbb16","html_url":"https://github.com/tidbcloud/terraform-provider-tidbcloud","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tidbcloud%2Fterraform-provider-tidbcloud","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tidbcloud%2Fterraform-provider-tidbcloud/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tidbcloud%2Fterraform-provider-tidbcloud/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tidbcloud%2Fterraform-provider-tidbcloud/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tidbcloud","download_url":"https://codeload.github.com/tidbcloud/terraform-provider-tidbcloud/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248886801,"owners_count":21177748,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["terraform","terraform-provider","tidb","tidbcloud","tidbcloud-provider"],"created_at":"2024-11-27T23:14:27.625Z","updated_at":"2025-04-14T13:23:07.717Z","avatar_url":"https://github.com/tidbcloud.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.pingcap.com/tidb-cloud/\"\u003e\u003cimg src=\".github/tidbcloud_logo.jpg\" alt=\"TiDB logo\" width=\"250\"/\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.terraform.io/\"\u003e\u003cimg src=\".github/terraform_logo.svg\" alt=\"Terraform logo\" width=\"250\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n# Terraform TiDB Cloud Provider\n\n[![License](https://img.shields.io/github/license/tidbcloud/terraform-provider-tidbcloud.svg)](https://github.com/tidbcloud/terraform-provider-tidbcloud/blob/master/LICENSE)\n[![Release](https://img.shields.io/github/v/release/tidbcloud/terraform-provider-tidbcloud?display_name=release)](https://github.com/tidbcloud/terraform-provider-tidbcloud/releases)\n\nThis is the repository for the terraform-provider-tidbcloud, which allows one to use Terraform with TiDB Cloud. Learn more about [TiDB Cloud](https://en.pingcap.com/tidb-cloud/)\n\nFor general information about Terraform, visit the [official website](https://www.terraform.io) and the [GitHub project page](https://github.com/hashicorp/terraform).\n\n# TOC\n\n- [Requirements](#requirements)\n- [Support](#support)\n- [Quick Start](#quick-start)\n- [User Guide](#user-guide)\n- [Developing the Provider](#developing-the-provider)\n  * [Environment](#environment)\n  * [Building the provider from source](#building-the-provider-from-source)\n  * [Generate or update documentation in docs file](#generate-or-update-documentation-in-docs-file)\n  * [Running the acceptance test](#running-the-acceptance-test)\n  * [Debug the provider](#debug-the-provider)\n- [Follow us](#follow-us)\n- [License](#license)\n\n## Requirements\n\n- [Terraform](https://www.terraform.io/downloads.html) \u003e= 1.0\n- [Go](https://golang.org/doc/install) \u003e= 1.18 (if you want to build the provider plugin)\n\n## Support\n\nResources\n- [cluster](./docs/resources/cluster.md)\n- [backup](./docs/resources/backup.md) (not support update)\n- [restore](./docs/resources/restore.md) (not support update and delete)\n- [import](./docs/resources/import.md) (not support update)\n\nDataSource\n- [projects](./docs/data-sources/projects.md)\n- [cluster specs](./docs/data-sources/cluster_specs.md)\n- [restores](./docs/data-sources/restores.md)\n- [backups](./docs/data-sources/backups.md)\n- [clusters](./docs/data-sources/clusters.md)\n\n## Quick Start\n\n### Install terraform\n\nInstall terraform in Mac. See [official doc](https://learn.hashicorp.com/tutorials/terraform/install-cli?in=terraform/aws-get-started) for other OS.\n\n```\nbrew tap hashicorp/tap\nbrew install hashicorp/tap/terraform\n```\n\n### Run the serverless example\n\n1. In a terminal clone the terraform-provider-tidbcloud repository.\n\n  ```\n  git clone git@github.com:tidbcloud/terraform-provider-tidbcloud.git\n  ```\n\n2. Go to the examples/workflows/tidbcloud_serverless_cluster directory.\n\n  ```\n  cd examples/workflows/tidbcloud_serverless_cluster\n  ```\n\n3. The provider requires an API key set in an environment variable. Copy the [API key](https://docs.pingcap.com/tidbcloud/api/v1beta#section/Authentication/API-Key-Management) from the TiDB Cloud console and create the environment variables.\n\n  ```\n  export TIDBCLOUD_PUBLIC_KEY=fake_public_key\n  export TIDBCLOUD_PRIVATE_KEY=fake_private_key\n  ```\n\n4. Rename the `terraform.tfvars.templates` to `terraform.tfvars` and change the variables as you wish. You can also pass them by environment variables.\n\n  ```\n  export TF_VAR_password=fake_password\n  export TF_VAR_cluster_name=fake_cluster_name\n  ```\n\n5. Execute the following commands to create a serverless tier\n\n  ```\n  terraform init\n  terraform apply --auto-approve\n  ```\n\n6. The example will output the `connection_strings` for you.\n\n  ```\n  connection_strings = {\n    \"default_user\" = \"3ybfFe46ZdoSR3b.root\"\n    \"standard\" = {\n      \"host\" = \"gateway01.us-west-2.prod.aws.tidbcloud.com\"\n      \"port\" = 4000\n    }\n    \"vpc_peering\" = {\n      \"host\" = \"\"\n      \"port\" = 0\n    }\n  }\n  ```\n\n  The `connection_strings` will be generated after the cluster is available. If you find the output is empty, you can execute the `terraform refersh` to refresh the state of cluster.\n\n## User Guide\n\nSee [TiDB Cloud Terraform Integration Overview](https://docs.pingcap.com/tidbcloud/terraform-tidbcloud-provider-overview) for more details.\n\n## Developing the Provider\n\n### Environment\n\nIf you wish to work on the provider, you'll first need [Go](http://www.golang.org) installed on your machine (see [Requirements](#requirements) above).\n\n### Building the provider from source\n\n1. Clone the repository\n```shell\ngit clone git@github.com:tidbcloud/terraform-provider-tidbcloud\n```\n2. Enter the repository directory\n```shell\ncd terraform-provider-tidbcloud\n```\n3. Build the provider using the Go `install` command. This will build the provider and put the provider binary in the `$GOPATH/bin` directory.\n```shell\ngo install\n```\n\n### Generate or update documentation in docs file\n\nrun `go generate`\n\n### Running the acceptance test\n\nsee [here](./internal/README.md) for more detail.\n\n### Debug the provider\n\nI will introduce how to debug with Terraform CLI development overrides. About other ways to debug the provider, see [terraform official doc](https://www.terraform.io/plugin/debugging) for more detail\n\nDevelopment overrides is a method of using a specified local filesystem Terraform provider binary with Terraform CLI, such as one locally built with updated code, rather than a released binary.\n\n1. create `.terraformrc` in your operating system user directory\n```\nprovider_installation {\n\n  dev_overrides {\n      \"tidbcloud/tidbcloud\" = \"\u003cput your $GOPATH/bin here\u003e\"\n  }\n\n  # For all other providers, install them directly from their origin provider\n  # registries as normal. If you omit this, Terraform will _only_ use\n  # the dev_overrides block, and so no other providers will be available.\n  direct {}\n}\n```\n\n2. run go install in the terraform-provider-tidbcloud, you will find the `terraform-provider-tidbcloud` will be installed under the `$GOPATH/bin` \n```\ngo install\n```\n\n3. Terraform CLI commands, such as terraform apply, will now use the specified provider binary if you follow the below config:\n```\nterraform {\n  required_providers {\n    tidbcloud = {\n      source = \"tidbcloud/tidbcloud\"\n    }\n  }\n}\n```\n\n## Follow us\n\nTwitter [@PingCAP](https://twitter.com/PingCAP)\n\n\n## License\n\nterraform-provider-tidbcloud is under the Apache 2.0 license. See the [LICENSE](./LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftidbcloud%2Fterraform-provider-tidbcloud","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftidbcloud%2Fterraform-provider-tidbcloud","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftidbcloud%2Fterraform-provider-tidbcloud/lists"}