Skip to content

Commit

Permalink
feat: Support NKS OpenAPI Features (#273)
Browse files Browse the repository at this point in the history
* update: support nks update

* update: nks docs

* fix: ip_acl empty entries error

* fix: ip_acl empty entries error

* update: docs & log

* update: nks_server_products example

* update: nks_server_products example

* update: nks ip-acl exception for fin site

* update: nks UserAgent config

* update: remove named result parameter

* update: nks config

* update: nks_cluster ip_acl_default_action validation

---------

Co-authored-by: Mingyum Kim <mingyum.kim@navercorp.com>
  • Loading branch information
gimmetm and Mingyum Kim authored Jun 15, 2023
1 parent b242fe0 commit 420ba38
Show file tree
Hide file tree
Showing 24 changed files with 1,713 additions and 76 deletions.
2 changes: 1 addition & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ builds:
flags:
- -trimpath
ldflags:
- "-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}"
- '-s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X {{ replace .GitURL "https://" "" }}/ncloud.version={{ .Version }}'
goos:
- freebsd
- windows
Expand Down
15 changes: 14 additions & 1 deletion docs/data-sources/nks_cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ In addition to all arguments above, the following attributes are exported:
* `id` - Cluster uuid.
* `endpoint` - Control Plane API address.
* `lb_private_subnet_no` - Subnet No. for private loadbalancer only.
* `lb_public_subnet_no` - Subnet No. for public loadbalancer only. (Available only `SGN` region`)
* `lb_public_subnet_no` - Subnet No. for public loadbalancer only. (Available only `SGN`, `JPN` region)
* `subnet_no_list` - Subnet No. list.
* `public_network` - Public Subnet Network
* `kube_network_plugin` - Kubernetes network plugin.
Expand All @@ -41,3 +41,16 @@ In addition to all arguments above, the following attributes are exported:
* `audit` - Audit log availability.
* `k8s_version` - Kubenretes version.
* `acg_no` - The ID of cluster ACG.
* `oidc`
* `issuer_url` - Issuer URL.
* `client_id` - Client ID.
* `username_prefix` - Username prefix.
* `username_claim` - Username claim.
* `groups_prefix` - Groups prefix.
* `groups_claim` - Groups claim.
* `required_claim` - Required claim.
* `ip_acl_default_action` - IP ACL default action.(Available only `public`, `gov` site)
* `ip_acl` (Available only `public`, `gov` site)
* `action` - `allow`, `deny`
* `address` - CIDR
* `comment` - Comment
7 changes: 5 additions & 2 deletions docs/data-sources/nks_node_pool.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@ In addition to all arguments above, the following attributes are exported:
* `id` - The ID of nodepool.`CusterUuid:NodePoolName`
* `node_count` - Number of nodes.
* `product_code` - Product code.
* `software_code` - Server image code.
* `autoscale`
* `enable` - Auto scaling availability.
* `max` - Maximum number of nodes available for auto scaling.
* `min` - Minimum number of nodes available for auto scaling.
* `subnet_no` - Subnet No.
* `subnet_no` - Subnet No.(Deprecated)
* `subnet_no_list` - Subnet No List.
* `instance_no` - Nodepool instance No.
* `nodes`- Running nodes in nodepool.
* `name` - The name of Server instance.
Expand All @@ -45,4 +47,5 @@ In addition to all arguments above, the following attributes are exported:
* `public_ip` - Public IP.
* `node_status` - Node Status.
* `container_version` - Container version of node.
* `kernel_version` - kernel version of node.
* `kernel_version` - kernel version of node.
* `k8s_version` - Kubenretes version .
33 changes: 33 additions & 0 deletions docs/data-sources/nks_server_images.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Data Source: ncloud_nks_server_images

Provides list of available Kubernetes Nodepool ServerImages.

## Example Usage

```hcl
data "ncloud_nks_server_images" "images" {}
data "ncloud_nks_server_images" "ubuntu20" {
filter {
name = "label"
values = ["ubuntu-20.04-64-server"]
regex = true
}
}
```

## 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 ServerImages
* `label` - ServerImage name
* `value` - ServerImage code
56 changes: 56 additions & 0 deletions docs/data-sources/nks_server_products.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Data Source: ncloud_nks_server_products

Provides list of available Kubernetes Nodepool ServerProducts.

## Example Usage

```hcl
data "ncloud_nks_server_products" "products" {}
data "ncloud_nks_server_images" "images"{
filter {
name = "label"
values = ["ubuntu-20.04-64-server"]
}
}
data "ncloud_nks_server_products" "product" {
software_code = data.ncloud_nks_server_images.images.images[0].value
zone = "KR-1"
filter {
name = "label"
values = ["vCPU 2개, 메모리 16GB, [SSD]디스크 50GB" ]
}
}
```

## Argument Reference

The following arguments are supported:

* `software_code` - (Required) NKS ServerImage code.
* `zone` - (Required) zone Code.

* `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

* `products` - A list of ServerProduct
* `label` - ServerProduct spec korean description
* `value` - ServerProduct code
* `detail`
* `cpu_count` - Number of cpu
* `gpu_count` - Number of gpu
* `gpu_memory_size` - Size of GPU memory(GB)
* `memory_size` - Size of memory(GB)
* `product_code` - ServerProduct code
* `product_english_desc` - ServerProduct spec english description
* `product_korean_desc` - ServerProduct spec korean description
* `product_type` - ServerProduct Type
18 changes: 15 additions & 3 deletions docs/resources/nks_cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,23 @@ The following arguments are supported:
* `subnet_no_list` - (Required) Subnet No. list.
* `public_network` - (Optional) Public Subnet Network (`boolean`)
* `lb_private_subnet_no` - (Required) Subnet No. for private loadbalancer only.
* `lb_public_subnet_no` - (Optional) Subnet No. for public loadbalancer only. (Available only `SGN` region)
* `lb_public_subnet_no` - (Optional) Subnet No. for public loadbalancer only. (Available only `SGN`, `JPN` region)
* `log` - (Optional)
* `audit` - (Required) Audit log availability. (`boolean`)
* `k8s_version` - (Optional) Kubenretes version .

* `k8s_version` - (Optional) Kubenretes version. Only upgrade is supported.
* `oidc` - (Optional)
* `issuer_url` - (Required) Issuer URL.
* `client_id` - (Required) Client ID.
* `username_prefix` - (Optional) Username prefix.
* `username_claim` - (Optional) Username claim.
* `groups_prefix` - (Optional) Groups prefix.
* `groups_claim` - (Optional) Groups claim.
* `required_claim` - (Optional) Required claim.
* `ip_acl_default_action` - (Optional) IP ACL default action.`allow`(default), `deny`
* `ip_acl` (Optional)
* `action` - (Required) `allow`, `deny`
* `address` - (Required) CIDR
* `comment` - (Optional) Comment
## Attributes Reference

In addition to all arguments above, the following attributes are exported:
Expand Down
5 changes: 4 additions & 1 deletion docs/resources/nks_node_pool.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,14 @@ The following arguments are supported:
* `cluster_uuid` - (Required) Cluster uuid.
* `node_count` - (Required) Number of nodes.
* `product_code` - (Required) Product code.
* `software_code` - (Optional) Server image code.
* `autoscale`- (Optional)
* `enable` - (Required) Auto scaling availability.
* `max` - (Required) Maximum number of nodes available for auto scaling.
* `min` - (Required) Minimum number of nodes available for auto scaling.
* `subnet_no` - (Optional) Subnet No.
* `subnet_no` - (Deprecated) Subnet No.
* `subnet_no_list` - Subnet no list.
* `k8s_version` - (Optional) Kubenretes version. Only upgrade is supported.

## Attributes Reference

Expand Down
15 changes: 9 additions & 6 deletions examples/nks/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,17 @@ resource "ncloud_nks_cluster" "cluster" {
}
}

data "ncloud_server_image" "image" {
data "ncloud_nks_server_images" "images"{
filter {
name = "product_name"
values = ["ubuntu-20.04"]
name = "label"
values = ["ubuntu-20.04-64-server"]
}
}

data "ncloud_server_product" "product" {
server_image_product_code = data.ncloud_server_image.image.product_code
data "ncloud_nks_server_products" "products" {

software_code = data.ncloud_nks_server_images.images.images[0].value
zone = "KR-1"

filter {
name = "product_type"
Expand Down Expand Up @@ -96,7 +98,8 @@ resource "ncloud_nks_node_pool" "node_pool" {
cluster_uuid = ncloud_nks_cluster.cluster.uuid
node_pool_name = "pool1"
node_count = 1
product_code = data.ncloud_server_product.product.product_code
product_code = data.ncloud_nks_server_products.products.products[0].value
software_code = data.ncloud_nks_server_images.images.images[0].value
subnet_no = ncloud_subnet.node_subnet.id
autoscale {
enabled = true
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/terraform-providers/terraform-provider-ncloud
go 1.19

require (
github.com/NaverCloudPlatform/ncloud-sdk-go-v2 v1.6.2
github.com/NaverCloudPlatform/ncloud-sdk-go-v2 v1.6.4
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320
github.com/hashicorp/terraform-plugin-sdk/v2 v2.24.1
gopkg.in/yaml.v3 v3.0.1
Expand Down
21 changes: 16 additions & 5 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03
github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA=
github.com/Microsoft/go-winio v0.4.16 h1:FtSW/jqD+l4ba5iPBj9CODVtgfYAD8w2wS923g/cFDk=
github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0=
github.com/NaverCloudPlatform/ncloud-sdk-go-v2 v1.6.2 h1:Hv2aCNGVVD4tKXYivtENi+9+/zgHL+H05uKMkqpr5Xk=
github.com/NaverCloudPlatform/ncloud-sdk-go-v2 v1.6.2/go.mod h1:KWd9AT+YSM6qgsMzPnE23h2/r0bsPSIdJzZIg3BUcfI=
github.com/NaverCloudPlatform/ncloud-sdk-go-v2 v1.6.4 h1:/PXqrDFlF3U/jjaGkrEpXYt6EKalENZjNaHaoHL6718=
github.com/NaverCloudPlatform/ncloud-sdk-go-v2 v1.6.4/go.mod h1:sDa6EITv6z/l6+d4VJk4OiRZnXuO0uG2Cm30qtqF4TU=
github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7 h1:YoJbenK9C67SkzkDfmQuVln04ygHj3vjZfd9FL+GmQQ=
github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7/go.mod h1:z4/9nQmJSSwwds7ejkxaJwO37dru3geImFUdJlaLzQo=
github.com/acomagu/bufpipe v1.0.3 h1:fxAGrHZTgQ9w5QqVItgzwj235/uYZYgbXitB+dLupOk=
Expand Down Expand Up @@ -181,6 +181,7 @@ github.com/vmihailenco/tagparser v0.1.1 h1:quXMXlA39OCbd2wAdTsGDlK9RkOk6Wuw+x37w
github.com/vmihailenco/tagparser v0.1.1/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI=
github.com/xanzy/ssh-agent v0.3.0 h1:wUMzuKtKilRgBAD1sUb8gOwwRr2FGoBVumcjoOACClI=
github.com/xanzy/ssh-agent v0.3.0/go.mod h1:3s9xbODqPuuhK9JV1R321M/FlMZSBvE5aY6eAcqrDh0=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
github.com/zclconf/go-cty v1.1.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s=
github.com/zclconf/go-cty v1.2.0/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8=
github.com/zclconf/go-cty v1.10.0/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk=
Expand All @@ -192,12 +193,14 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk
golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20220517005047-85d78b3ac167 h1:O8uGbHCqlTp2P6QJSLmCojM4mN6UemYv8K+dCnmHmu0=
golang.org/x/crypto v0.0.0-20220517005047-85d78b3ac167/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
Expand All @@ -206,12 +209,13 @@ golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73r
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191009170851-d66e71096ffb/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210326060303-6b1517762897/go.mod h1:uSPa2vr4CLtc/ILN5odXGNXS6mhrKVzTaCXzk9m6W3k=
golang.org/x/net v0.0.0-20211123203042-d83791d6bcd9/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g=
golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
Expand All @@ -220,6 +224,7 @@ golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
Expand All @@ -231,28 +236,34 @@ golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210502180810-71e4cd670f79/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.5.0 h1:n2a8QNdAb0sZNpU9R1ALUXBbY+w51fCQDN+7EdxNBsY=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
Expand Down
6 changes: 5 additions & 1 deletion ncloud/config.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package ncloud

import (
"fmt"
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/vautoscaling"
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/vcdss"
"github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/vloadbalancer"
Expand Down Expand Up @@ -35,6 +36,8 @@ const DefaultCreateTimeout = 1 * time.Hour
const DefaultUpdateTimeout = 10 * time.Minute
const DefaultStopTimeout = 5 * time.Minute

var version = ""

type Config struct {
AccessKey string
SecretKey string
Expand Down Expand Up @@ -68,6 +71,7 @@ func (c *Config) Client() (*NcloudAPIClient, error) {
AccessKey: c.AccessKey,
SecretKey: c.SecretKey,
}

return &NcloudAPIClient{
server: server.NewAPIClient(server.NewConfiguration(apiKey)),
autoscaling: autoscaling.NewAPIClient(autoscaling.NewConfiguration(apiKey)),
Expand All @@ -80,7 +84,7 @@ func (c *Config) Client() (*NcloudAPIClient, error) {
vnas: vnas.NewAPIClient(vnas.NewConfiguration(apiKey)),
vautoscaling: vautoscaling.NewAPIClient(vautoscaling.NewConfiguration(apiKey)),
vloadbalancer: vloadbalancer.NewAPIClient(vloadbalancer.NewConfiguration(apiKey)),
vnks: vnks.NewAPIClient(vnks.NewConfiguration(c.Region, apiKey)),
vnks: vnks.NewAPIClient(vnks.NewConfigurationWithUserAgent(c.Region, fmt.Sprintf("Ncloud Terraform Provider/%s", version), apiKey)),
sourcecommit: sourcecommit.NewAPIClient(sourcecommit.NewConfiguration(c.Region, apiKey)),
sourcebuild: sourcebuild.NewAPIClient((sourcebuild.NewConfiguration(c.Region, apiKey))),
sourcepipeline: sourcepipeline.NewAPIClient(sourcepipeline.NewConfiguration(c.Region, apiKey)),
Expand Down
Loading

0 comments on commit 420ba38

Please sign in to comment.