Skip to content

Commit

Permalink
update doc (#11)
Browse files Browse the repository at this point in the history
Co-authored-by: Xiang Zhang <angwerzx@126.com>
  • Loading branch information
shiyuhang0 and zhangyangyu authored Sep 20, 2022
1 parent 8ff15e5 commit 5038c0c
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 1 deletion.
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ Turn to [TiDB Cloud API doc](https://docs.pingcap.com/tidbcloud/api/v1beta#secti

### Get TiDB Cloud provider

Create a main.tf file to get the TiDB Cloud provider:
Create a main.tf file:

```
terraform {
Expand All @@ -105,6 +105,27 @@ terraform {
- The `version` attribute is optional which defines the version of the provider, it will use the latest version by default
- The `required_version` is optional which defines the version of the terraform, it will use the latest version by default

To get the TiDB Cloud provider, execute `terraform init`. It will download the provider from terraform registry
```
$ terraform init
Initializing the backend...
Initializing provider plugins...
- Reusing previous version of tidbcloud/tidbcloud from the dependency lock file
- Using previously-installed tidbcloud/tidbcloud v0.0.1
Terraform has been successfully initialized!
You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.
If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.
```

### Config the provider

You need to config the provider like:
Expand Down
12 changes: 12 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@ description: |-
## Example Usage

```terraform
# We provide a full example in README https://github.com/tidbcloud/terraform-provider-tidbcloud
terraform {
required_providers {
tidbcloud = {
source = "tidbcloud/tidbcloud"
version = "~> 0.0.1"
}
}
required_version = ">= 1.0.0"
}
provider "tidbcloud" {
username = "fake_username"
password = "fake_password"
Expand Down
12 changes: 12 additions & 0 deletions examples/provider/provider.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# We provide a full example in README https://github.com/tidbcloud/terraform-provider-tidbcloud

terraform {
required_providers {
tidbcloud = {
source = "tidbcloud/tidbcloud"
version = "~> 0.0.1"
}
}
required_version = ">= 1.0.0"
}

provider "tidbcloud" {
username = "fake_username"
password = "fake_password"
Expand Down

0 comments on commit 5038c0c

Please sign in to comment.