Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(doc): update #23

Merged
merged 1 commit into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 11 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,24 @@ This is the repository for the terraform-provider-zillizcloud, which allows one

For general information about Terraform, visit the [official website](https://www.terraform.io) and the [GitHub project page](https://github.com/hashicorp/terraform).

## Support
Resources
- [cluster](./docs/resources/cluster.md)
- create
- scale
- import

DataSource

- [project](./docs/data-sources/project.md)
- [region](./docs/data-sources/regions.md)
- AWS
- GCP
- Azure
- Alibaba Cloud
- Tecent Cloud
## Table of Contents
<!-- toc -->

## API Documentation
- [User Guide](#user-guide)
- [API Documentation](#api-documentation)
- [Requirements](#requirements)
- [Building The Provider](#building-the-provider)

<!-- tocstop -->

API Documentation can be found on the [Terraform Registry](https://registry.terraform.io/providers/zilliztech/zillizcloud/latest/docs).

## User Guide

See [Zilliz Cloud Terraform Integration Overview](./docs/README.md) for more information.

## API Documentation

API Documentation can be found on the [Terraform Registry](https://registry.terraform.io/providers/zilliztech/zillizcloud/latest/docs).

## Requirements

Expand Down
68 changes: 68 additions & 0 deletions docs/create-a-stand-cluster.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Tutorial: Creating Zilliz a Standard Cloud Cluster Resources with Terraform

This tutorial guides you through managing Zilliz Cloud clusters using the `zillizcloud_cluster` resource within Terraform. You'll learn how to:

- Retrieve project and region IDs for cluster creation.
- Define clusters with various configurations in Terraform.
- Plan and apply changes to provision clusters in Zilliz Cloud.
- Verify the creation of your Zilliz Cloud clusters.

### Prerequisites

Before you begin, make sure you have completed the initial setup steps outlined in the [Getting Started with Zilliz Cloud Terraform Provider](./get-start.md) guide. Additionally, ensure that you have the necessary permissions and access credentials to interact with the Zilliz Cloud API.


## Retrieving Project IDs in Your Zilliz Cloud Account

[How Can I Obtain the Project ID ?](https://support.zilliz.com/hc/en-us/articles/22048954409755-How-Can-I-Obtain-the-Project-ID)

For convenience, you can use the `zillizcloud_project` data source to retrieve the ID of default project for your Zilliz Cloud account.


## Acquiring Region IDs for Zilliz Cloud Cluster

[Cloud Providers & Regions](https://docs.zilliz.com/docs/cloud-providers-and-regions)

In this tutorial, we will use the `aws-us-east-2` region.

### Creating a Cluster

With the `project ID` and `region ID` at hand, creating Zilliz Cloud clusters is straightforward. Below is an illustrative example defining zillizcloud_cluster resources within Terraform configuration:


```hcl

data "zillizcloud_project" "default" {
# Fetching the default project information to be used in cluster provisioning
}

resource "zillizcloud_cluster" "standard_plan_cluster" {
cluster_name = "Cluster-02" # The name of the cluster
region_id = "aws-us-east-2" # The region where the cluster will be deployed
plan = "Standard" # The service plan for the cluster
cu_size = "1" # The size of the compute unit
cu_type = "Performance-optimized" # The type of compute unit, optimized for performance
project_id = data.zillizcloud_project.default.id # Linking to the project ID fetched earlier
}
```
This example will create a Zilliz Cloud cluster:
- **Standard Plan Cluster**: This configuration creates a more advanced cluster named "Cluster-02" in the `aws-us-east-2` region. It uses the "Standard" service plan with a compute unit size of 1, optimized for performance, making it suitable for more demanding workloads.

### Planning and Applying Changes

Once you've defined the cluster resources, it's time to apply the changes to provision the Zilliz Cloud clusters. Navigate to your Terraform project directory and execute the following commands:

```bash
terraform apply -auto-approve
```

**Note**: The `-auto-approve` flag avoids prompting for confirmation before applying the changes. Use caution, especially in production environments. It's recommended to thoroughly review the plan before applying.

Review the plan generated by Terraform and confirm to apply the changes. Terraform will orchestrate the creation of the specified clusters based on your configuration.

### Verifying Provisioned Clusters

After applying the changes, you can verify the provisioned Zilliz Cloud clusters either through the Zilliz Cloud dashboard. Ensure that the clusters are created with the desired configurations and are functioning as expected.

## Next Steps
- [Upgrading Zilliz Cloud Cluster Compute Unit Size with Terraform](./scale-cluster.md)
48 changes: 48 additions & 0 deletions docs/create-a-starter-cluster.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Tutorial: Creating Zilliz a Starter Cloud Cluster Resources with Terraform

This tutorial guides you through managing Zilliz Cloud clusters using the `zillizcloud_cluster` resource within Terraform. You'll learn how to:

- Retrieve project and region IDs for cluster creation.
- Define clusters with various configurations in Terraform.
- Plan and apply changes to provision clusters in Zilliz Cloud.
- Verify the creation of your Zilliz Cloud clusters.

### Prerequisites

Before you begin, make sure you have completed the initial setup steps outlined in the [Getting Started with Zilliz Cloud Terraform Provider](./get-start.md) guide. Additionally, ensure that you have the necessary permissions and access credentials to interact with the Zilliz Cloud API.


### Creating a Cluster

With the `project ID` at hand, creating Zilliz Cloud clusters is straightforward. Below is an illustrative example defining zillizcloud_cluster resources within Terraform configuration:


```hcl

data "zillizcloud_project" "default" {}

resource "zillizcloud_cluster" "starter_cluster" {
cluster_name = "Cluster-01"
project_id = data.zillizcloud_project.default.id
}

```
This example will create two Zilliz Cloud clusters:
- **Starter Cluster**: This configuration creates a basic cluster named "Cluster-01" within the default project. It's suitable for initial testing or small-scale applications.

### Planning and Applying Changes

Once you've defined the cluster resources, it's time to apply the changes to provision the Zilliz Cloud clusters. Navigate to your Terraform project directory and execute the following commands:

```bash
terraform apply -auto-approve
```

**Note**: The `-auto-approve` flag avoids prompting for confirmation before applying the changes. Use caution, especially in production environments. It's recommended to thoroughly review the plan before applying.

Review the plan generated by Terraform and confirm to apply the changes. Terraform will orchestrate the creation of the specified clusters based on your configuration.

### Verifying Provisioned Clusters

After applying the changes, you can verify the provisioned Zilliz Cloud clusters either through the Zilliz Cloud dashboard. Ensure that the clusters are created with the desired configurations and are functioning as expected.

163 changes: 0 additions & 163 deletions docs/create-cluster.md

This file was deleted.

39 changes: 30 additions & 9 deletions docs/get-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Before you begin, ensure you have the following:

2. **Zilliz Cloud Account**: Access to Zilliz Cloud and your API Key are essential. Refer to the [documentation](https://docs.zilliz.com/docs/manage-api-keys) to obtain your API key.

## 2. Configure Terraform Provider
## 2. Download Zilliz Cloud Terraform Provider

Start by configuring the Zilliz Cloud provider within your Terraform configuration file (`main.tf`). Follow these steps:

Expand All @@ -22,26 +22,47 @@ terraform {
}
}
}
```

## 3. Initialize Terraform Configuration

Initialize the Terraform configuration by running:

```bash
terraform init
```

Terraform will download the `zillizcloud` provider and install it in a hidden subdirectory of your current working directory, named `.terraform`.

### 4. Authenticate Zilliz Cloud Terraform Provider

Your Zilliz Cloud API Key is required to use the Terraform Provider. There are two ways to configure this.

#### Option 1: Specify API Key in Provider Block

Append the following code to your `main.tf` file:

```hcl
provider "zillizcloud" {
api_key = "<your-api-key>"
}
```

Replace `<your-api-key>` with your Zilliz Cloud API Key.

Alternatively, you can use the environment variable `ZILLIZCLOUD_API_KEY` instead of specifying it in the provider block.
#### Option 2: Use Environment Variable

Set the API key as an environment variable:

```bash
$ export ZILLIZCLOUD_API_KEY="<your-api-key>"
export ZILLIZCLOUD_API_KEY="<your-api-key>"
```

## 3. Initialize Terraform Configuration

Initialize the Terraform configuration by running:
Then the provider declaration in your `main.tf` file is simply:

```bash
terraform init
```hcl
provider "zillizcloud" {
}
```

Terraform will download the `zillizcloud` provider and install it in a hidden subdirectory of your current working directory, named `.terraform`.
By following these steps, you should have the Zilliz Cloud Terraform provider configured and ready to use in your Terraform projects.
Loading
Loading