-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add Search Engine Service resources and data (#255)
* support search engine service - intial commit * support search engine service - review 반영 * support search engine service - data-sources, resources md 파일 추가 * support search engine service - remove unnecessary text * support search engine service - add attribute "type", "version" in ses_version * support search engine service - add validation for cluster name * support search engine service - change uuid to id * support search engine service - return error when decrease data node count * support search engine service - set MaxItems * support search engine service - resource_ses_cluster change master_node attribute's description * support search engine service - ses_versions add filter examples * support search engine service - fix os_images document & change "versions" attribute to "images" in data_source_ncloud_ses_node_os_images * support search engine service - fix ses_node_os_images document * support search engine service - fix ses_versions document * support search engine service - fix ses_node_products document * support search engine service - change memory size long value to string(GB) format * support search engine service - change master node's attribute(remove is_master_only_node_activated field & master_node block optional) * support search engine service - master node count validation * support search engine service - fix ses_cluster document(data node count) & validate data node count's min value * support search engine service - validate data node storage size * support search engine service - change node product code * Apply suggestions from code review * support search engine service - remove timeouts * Update docs/data-sources/ses_cluster.md * support search engine service - rollback (remove timeouts) * support search engine service - return error when reset password fail * support search engine service - update ncloud go sdk version 1.5.6 to 1.5.8 Co-authored-by: minosmlee <[email protected]>
- Loading branch information
1 parent
09bdc9c
commit 868a980
Showing
24 changed files
with
2,237 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# Data Source: ncloud_ses_cluster | ||
|
||
Provides a Search Engine Service cluster data. | ||
|
||
## Example Usage | ||
``` hcl | ||
variable "ses_cluster_name" {} | ||
data "ncloud_ses_clusters" "clusters"{ | ||
filter { | ||
name = "cluster_name" | ||
values = [var.ses_cluster_name] | ||
} | ||
} | ||
data "ncloud_ses_cluster" "my_cluster"{ | ||
id = data.ncloud_ses_clusters.clusters.clusters.0.id | ||
} | ||
``` | ||
|
||
## Argument Reference | ||
The following arguments are supported | ||
|
||
* `id` - (Required) Cluster Instance No. | ||
|
||
## Attribute Reference | ||
In addition to all arguments above, the following attributes are exported | ||
|
||
* `cluster_name` - Cluster name. | ||
* `service_group_instance_no` - Cluster Instance No. | ||
* `id` - Cluster Instance No. | ||
* `os_image_code` - OS type to be used. | ||
* `vpc_no` - VPC number to be used. | ||
* `search_engine` - . | ||
* `version_code` - Search Engine Service version to be used. | ||
* `user_name` - Search Engine UserName. Only lowercase alphanumeric characters and non-consecutive hyphens (-) allowed First character must be a letter, but the last character may be a letter or a number. | ||
* `port` - Search Engine Port. | ||
* `dashboard_port` - Search Engine Dashboard Port. | ||
* `manager_node` - . | ||
* `is_dual_manager` - Redundancy of manager node | ||
* `product_code` - HW specifications of the manager node. | ||
* `subnet_no` - Subnet number where the manager node is to be located. | ||
* `acg_id` - The ID of manager node ACG. | ||
* `acg_name` - The name of manager node ACG. | ||
* `data_node` - . | ||
* `product_code` - HW specifications of the data node. | ||
* `subnet_no` - Subnet number where the data node is to be located. | ||
* `node_count` - Number of data nodes. At least 3 units, up to 10 units allowed. | ||
* `storage_size` - Data node storage capacity. | ||
* `acg_id` - The ID of data node ACG. | ||
* `acg_name` - The name of data node ACG. | ||
* `master_node(Optional)` - . | ||
* `product_code` - HW specifications of the master node. | ||
* `subnet_no` - Subnet number where the master node is to be located. | ||
* `node_count` - Number of master nodes. | ||
* `acg_id` - The ID of master node ACG. | ||
* `acg_name` - The name of master node ACG. | ||
* `manager_node_instance_no_list` - List of Manager node's instance number | ||
* `cluster_node_list` - . | ||
* `compute_instance_name` - The name of Server instance. | ||
* `compute_instance_no` - The ID of Server instance. | ||
* `node_type` - Node role code | ||
* `private_ip` - Private IP | ||
* `server_status` - The status of Server Instance. | ||
* `subnet` - The name of Server Instance subnet. | ||
* `login_key_name` - Required Login key to access Manager node server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Data Source: ncloud_ses_clusters | ||
|
||
Provides list of Search Engine Service cluster uuid. | ||
|
||
## Example Usage | ||
``` hcl | ||
data "ncloud_ses_clusters" "clusters"{ | ||
} | ||
data "ncloud_ses_clusters" "cluster"{ | ||
filter { | ||
name = "cluster_name" | ||
values = ["my_cluster"] | ||
} | ||
} | ||
``` | ||
|
||
## Attribute Reference | ||
* `clusters` - A List of Search Engine Service cluster. | ||
|
||
### Search Engine Service Cluster Reference | ||
`clusters` are also exported with the following attributes, when there are relevant: Each element supports the following: | ||
|
||
* `id` - Cluster Instance No. | ||
* `service_group_instance_no` - Cluster Instance No(Same as Cluster Id). | ||
* `cluster_name` - Cluster name. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Data Source: ncloud_ses_node_os_images | ||
|
||
Provides list of available Server OS images. | ||
|
||
## Example Usage | ||
|
||
```hcl | ||
data "ncloud_ses_node_os_images" "all_images" {} | ||
data "ncloud_ses_node_os_images" "CentOS_7-8" { | ||
filter { | ||
name = "name" | ||
values = ["CentOS 7.8 (64-bit)"] | ||
} | ||
} | ||
data "ncloud_ses_node_os_images" "CentOS_7-8" { | ||
filter { | ||
name = "id" | ||
values = ["SW.VELST.OS.LNX64.CNTOS.0708.B050"] | ||
} | ||
} | ||
``` | ||
|
||
## Argument Reference | ||
The following arguments are supported: | ||
|
||
* `filter` - (Optional) Custom filter block as described below. | ||
* `name` - (Required) The name of the field to filter by. | ||
* `values` - (Required) Set of values that are accepted for the given field. | ||
* `regex` - (Optional) is `values` treated as a regular expression. | ||
|
||
## Attributes Reference | ||
|
||
* `images` - A List of OS image product. | ||
|
||
### OS Image Product Reference | ||
`images` are also exported with the following attributes, when there are relevant: Each element supports the following: | ||
|
||
* `id` - The ID of OS image product. | ||
* `name` - OS image name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Data Source: ncloud_ses_node_products | ||
|
||
Provides list of available Server product. | ||
|
||
## Example Usage | ||
|
||
```hcl | ||
variable "subnet_no" {} | ||
data "ncloud_ses_node_os_images" "os_images" {} | ||
data "ncloud_ses_node_products" "node_products" { | ||
os_image_code = data.ncloud_ses_node_os_images.os_images.images.0.id | ||
subnet_no = var.subnet_no | ||
filter { | ||
name = "cpu_count" | ||
values = ["2"] | ||
} | ||
} | ||
``` | ||
|
||
## Argument Reference | ||
The following arguments are supported: | ||
* `os_image_code` - (Required) OS type to be used. | ||
* `subnet_no` - (Required) Subnet number where the node will be located. | ||
* `filter` - (Optional) Custom filter block as described below. | ||
* `name` - (Required) The name of the field to filter by. | ||
* `values` - (Required) Set of values that are accepted for the given field. | ||
* `regex` - (Optional) is `values` treated as a regular expression. | ||
|
||
## Attributes Reference | ||
|
||
* `codes` - A List of server product. | ||
|
||
### Node Product Reference | ||
`codes` are also exported with the following attributes, when there are relevant: Each element supports the following: | ||
|
||
* `id` - The value of server product code. | ||
* `cpu_count` - CPU count. | ||
* `memory_size` - Memory size. | ||
* `name` - Product name. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Data Source: ncloud_ses_versions | ||
|
||
Provides list of available Search Engine Service versions. | ||
|
||
## Example Usage | ||
|
||
```hcl | ||
data "ncloud_ses_versions" "versions" {} | ||
data "ncloud_ses_versions" "opensearch_v133" { | ||
filter { | ||
name = "id" | ||
values = ["133"] | ||
} | ||
} | ||
data "ncloud_ses_versions" "opensearch_v133" { | ||
filter { | ||
name = "type" | ||
values = ["OpenSearch"] | ||
} | ||
} | ||
data "ncloud_ses_versions" "opensearch_v133" { | ||
filter { | ||
name = "version" | ||
values = ["1.3.3"] | ||
} | ||
} | ||
``` | ||
|
||
## Argument Reference | ||
The following arguments are supported: | ||
|
||
* `filter` - (Optional) Custom filter block as described below. | ||
* `name` - (Required) The name of the field to filter by. | ||
* `values` - (Required) Set of values that are accepted for the given field. | ||
* `regex` - (Optional) is `values` treated as a regular expression. | ||
|
||
## Attributes Reference | ||
|
||
* `versions` - A List of SES Version. | ||
|
||
### Search Engine Service Version Reference | ||
`versions` are also exported with the following attributes, when there are relevant: Each element supports the following: | ||
|
||
* `id` - The Code of SES Version | ||
* `name` - SES version name | ||
* `type` - SES version type | ||
* `version` - SES version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
# Resource: ncloud_ses_cluster | ||
|
||
Provides a Search Engine Service cluster resource. | ||
|
||
## Example Usage | ||
|
||
``` hcl | ||
variable ses_user_password { | ||
description = "SES Cluster User Password" | ||
type = string | ||
sensitive = true | ||
} | ||
resource "ncloud_vpc" "vpc" { | ||
name = "tf-vpc" | ||
ipv4_cidr_block = "172.16.0.0/16" | ||
} | ||
resource "ncloud_subnet" "node_subnet" { | ||
vpc_no = ncloud_vpc.vpc.vpc_no | ||
name = "tf-subnet" | ||
subnet = "172.16.1.0/24" | ||
zone = "KR-2" | ||
network_acl_no = ncloud_vpc.vpc.default_network_acl_no | ||
subnet_type = "PRIVATE" | ||
usage_type = "GEN" | ||
} | ||
data "ncloud_ses_versions" "ses_versions" { | ||
} | ||
data "ncloud_ses_node_os_images" "os_images" { | ||
} | ||
data "ncloud_ses_node_products" "product_codes" { | ||
os_image_code = data.ncloud_ses_node_os_images.os_images.images.0.id | ||
subnet_no = ncloud_subnet.node_subnet.id | ||
} | ||
resource "ncloud_login_key" "loginkey" { | ||
key_name = "tf-login-key" | ||
} | ||
resource "ncloud_ses_cluster" "cluster" { | ||
cluster_name = "tf-cluster" | ||
os_image_code = data.ncloud_ses_node_os_images.os_images.images.0.id | ||
vpc_no = ncloud_vpc.vpc.id | ||
search_engine { | ||
version_code = data.ncloud_ses_versions.ses_versions.versions.0.id | ||
user_name = "admin" | ||
user_password = var.ses_user_password | ||
dashboard_port = "5601" | ||
} | ||
manager_node { | ||
is_dual_manager = false | ||
product_code = data.ncloud_ses_node_products.product_codes.codes.0.id | ||
subnet_no = ncloud_subnet.node_subnet.id | ||
} | ||
data_node { | ||
product_code = data.ncloud_ses_node_products.product_codes.codes.0.id | ||
subnet_no = ncloud_subnet.node_subnet.id | ||
count = 3 | ||
storage_size = 100 | ||
} | ||
master_node { | ||
product_code = data.ncloud_ses_node_products.product_codes.codes.0.id | ||
subnet_no = ncloud_subnet.node_subnet.id | ||
count = 3 | ||
} | ||
login_key_name = ncloud_login_key.loginkey.key_name | ||
} | ||
``` | ||
|
||
## Argument Reference | ||
The following arguments are supported: | ||
|
||
* `cluster_name` - Cluster name. | ||
* `os_image_code` - OS type to be used. | ||
* `vpc_no` - VPC number to be used. | ||
* `search_engine` - . | ||
* `version_code` - Search Engine Service version to be used. | ||
* `user_name` - Search Engine UserName. Only lowercase alphanumeric characters and non-consecutive hyphens (-) allowed First character must be a letter, but the last character may be a letter or a number. | ||
* `user_password` - Search Engine User password. Must be at least 8 characters and contain at least one of each: English uppercase letter, lowercase letter, special character, and number. | ||
* `dashboard_port` - Search Engine Dashboard port. | ||
* `manager_node` - . | ||
* `is_dual_manager` - Redundancy of manager node | ||
* `product_code` - HW specifications of the manager node. | ||
* `subnet_no` - Subnet number where the manager node is to be located. | ||
* `data_node` - . | ||
* `product_code` - HW specifications of the data node. | ||
* `subnet_no` - Subnet number where the data node is to be located. | ||
* `count` - Number of data nodes. At least 3 units. (Can only be increased) | ||
* `storage_size` - Data node storage capacity. At least 100 GB, up to 2000 GB. Must be in units of 10 GB. | ||
* `master_node(Optional)` - If declared, creates a master-only node. | ||
* `product_code` - HW specifications of the master node. | ||
* `subnet_no` - Subnet number where the master node is to be located. | ||
* `count` - Number of master nodes. Only 3 or 5 units are available. | ||
* `login_key_name` - Required Login key to access Manager node server | ||
|
||
## Attribute Reference | ||
In addition to all arguments above, the following attributes are exported | ||
|
||
* `id` - Cluster Instance No. | ||
* `service_group_instance_no` - Cluster Instance No. (It is the same result as `id`) | ||
* `manager_node` - . | ||
* `acg_id` - The ID of manager node ACG. | ||
* `acg_name` - The name of manager node ACG. | ||
* `data_node` - . | ||
* `acg_id` - The ID of data node ACG. | ||
* `acg_name` - The name of data node ACG. | ||
* `master_node` - . | ||
* `acg_id` - The ID of master node ACG. | ||
* `acg_name` - The name of master node ACG. | ||
* `manager_node_instance_no_list` - List of Manager node's instance number | ||
* `cluster_node_list` - . | ||
* `compute_instance_name` - The name of Server instance. | ||
* `compute_instance_no` - The ID of Server instance. | ||
* `node_type` - Node role code | ||
* `private_ip` - Private IP | ||
* `server_status` - The status of Server Instance. | ||
* `subnet` - The name of Server Instance subnet. |
Oops, something went wrong.