From 2009892f928387cf4c3c7dcc7664f39f39a11121 Mon Sep 17 00:00:00 2001 From: Liang Huang Date: Mon, 4 Mar 2024 20:07:17 +0800 Subject: [PATCH] update examples Signed-off-by: Liang Huang --- .../scaffolding_example/data-source.tf | 3 --- .../zilliz_cloud_providers/data-source.tf | 13 +++++++++ .../zilliz_cloud_regions/data-source.tf | 17 ++++++++++++ .../zilliz_cluster/data-source.tf | 26 ++++++++++++++++++ .../zilliz_clusters/data-source.tf | 18 +++++++++++++ .../zilliz_projects/data-source.tf | 13 +++++++++ examples/provider/provider.tf | 12 +++++++-- .../resources/scaffolding_example/resource.tf | 3 --- examples/resources/zilliz_cluster/resource.tf | 27 +++++++++++++++++++ 9 files changed, 124 insertions(+), 8 deletions(-) delete mode 100644 examples/data-sources/scaffolding_example/data-source.tf create mode 100644 examples/data-sources/zilliz_cloud_providers/data-source.tf create mode 100644 examples/data-sources/zilliz_cloud_regions/data-source.tf create mode 100644 examples/data-sources/zilliz_cluster/data-source.tf create mode 100644 examples/data-sources/zilliz_clusters/data-source.tf create mode 100644 examples/data-sources/zilliz_projects/data-source.tf delete mode 100644 examples/resources/scaffolding_example/resource.tf create mode 100644 examples/resources/zilliz_cluster/resource.tf diff --git a/examples/data-sources/scaffolding_example/data-source.tf b/examples/data-sources/scaffolding_example/data-source.tf deleted file mode 100644 index a852489..0000000 --- a/examples/data-sources/scaffolding_example/data-source.tf +++ /dev/null @@ -1,3 +0,0 @@ -data "scaffolding_example" "example" { - configurable_attribute = "some-value" -} diff --git a/examples/data-sources/zilliz_cloud_providers/data-source.tf b/examples/data-sources/zilliz_cloud_providers/data-source.tf new file mode 100644 index 0000000..91fce40 --- /dev/null +++ b/examples/data-sources/zilliz_cloud_providers/data-source.tf @@ -0,0 +1,13 @@ +terraform { + required_providers { + zilliz = { + source = "zilliztech/zillizcloud" + } + } +} + +provider "zilliz" { + cloud_region_id = "gcp-us-west1" +} + +data "zilliz_cloud_providers" "example" {} diff --git a/examples/data-sources/zilliz_cloud_regions/data-source.tf b/examples/data-sources/zilliz_cloud_regions/data-source.tf new file mode 100644 index 0000000..6bda0ab --- /dev/null +++ b/examples/data-sources/zilliz_cloud_regions/data-source.tf @@ -0,0 +1,17 @@ +terraform { + required_providers { + zilliz = { + source = "zilliztech/zillizcloud" + } + } +} + +provider "zilliz" { + cloud_region_id = "gcp-us-west1" +} + +data "zilliz_cloud_providers" "example" {} + +data "zilliz_cloud_regions" "example" { + cloud_id = data.zilliz_cloud_providers.example.cloud_providers[0].cloud_id +} diff --git a/examples/data-sources/zilliz_cluster/data-source.tf b/examples/data-sources/zilliz_cluster/data-source.tf new file mode 100644 index 0000000..2526993 --- /dev/null +++ b/examples/data-sources/zilliz_cluster/data-source.tf @@ -0,0 +1,26 @@ +terraform { + required_providers { + zilliz = { + source = "zilliztech/zillizcloud" + } + } +} + +provider "zilliz" { + cloud_region_id = "gcp-us-west1" +} + +data "zilliz_projects" "test" { +} + +resource "zilliz_cluster" "test" { + plan = "Standard" + cluster_name = "Cluster-Test1" + cu_size = 1 + cu_type = "Performance-optimized" + project_id = data.zilliz_projects.test.projects[0].project_id +} + +data "zilliz_cluster" "test" { + id = zilliz_cluster.test.id +} \ No newline at end of file diff --git a/examples/data-sources/zilliz_clusters/data-source.tf b/examples/data-sources/zilliz_clusters/data-source.tf new file mode 100644 index 0000000..290cd17 --- /dev/null +++ b/examples/data-sources/zilliz_clusters/data-source.tf @@ -0,0 +1,18 @@ +terraform { + required_providers { + zilliz = { + source = "zilliztech/zillizcloud" + } + } +} + +provider "zilliz" { + cloud_region_id = "gcp-us-west1" +} + +data "zilliz_clusters" "example" {} + +output "clusters" { + value = data.zilliz_clusters.example.clusters +} + diff --git a/examples/data-sources/zilliz_projects/data-source.tf b/examples/data-sources/zilliz_projects/data-source.tf new file mode 100644 index 0000000..3e48310 --- /dev/null +++ b/examples/data-sources/zilliz_projects/data-source.tf @@ -0,0 +1,13 @@ +terraform { + required_providers { + zilliz = { + source = "zilliztech/zillizcloud" + } + } +} + +provider "zilliz" { + cloud_region_id = "gcp-us-west1" +} + +data "zilliz_projects" "example" {} diff --git a/examples/provider/provider.tf b/examples/provider/provider.tf index 942db45..f788114 100644 --- a/examples/provider/provider.tf +++ b/examples/provider/provider.tf @@ -1,3 +1,11 @@ -provider "scaffolding" { - # example configuration here +terraform { + required_providers { + zilliz = { + source = "zilliztech/zillizcloud" + } + } +} + +provider "zilliz" { + cloud_region_id = "gcp-us-west1" } diff --git a/examples/resources/scaffolding_example/resource.tf b/examples/resources/scaffolding_example/resource.tf deleted file mode 100644 index 9ae3f57..0000000 --- a/examples/resources/scaffolding_example/resource.tf +++ /dev/null @@ -1,3 +0,0 @@ -resource "scaffolding_example" "example" { - configurable_attribute = "some-value" -} diff --git a/examples/resources/zilliz_cluster/resource.tf b/examples/resources/zilliz_cluster/resource.tf new file mode 100644 index 0000000..877a107 --- /dev/null +++ b/examples/resources/zilliz_cluster/resource.tf @@ -0,0 +1,27 @@ +terraform { + required_providers { + zilliz = { + source = "zilliztech/zillizcloud" + } + } +} + +provider "zilliz" { + cloud_region_id = "gcp-us-west1" +} + +data "zilliz_projects" "test" { +} + +# resource "zilliz_cluster" "test" { +# plan = "Standard" +# cluster_name = "Cluster-01" +# cu_size = "1" +# cu_type = "Performance-optimized" +# project_id = data.zilliz_projects.test.projects[0].project_id +# } + +resource "zilliz_cluster" "serverless_test" { + cluster_name = "Cluster-02" + project_id = data.zilliz_projects.test.projects[0].project_id +}