Skip to content

Commit 37b04e6

Browse files
authored
Merge pull request #47 from sethpollack/kong_admin_token
Add KONG_ADMIN_TOKEN (Enterprise Edition)
2 parents cacfc52 + 85062cf commit 37b04e6

File tree

6 files changed

+26
-10
lines changed

6 files changed

+26
-10
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ You can use environment variables to set the provider properties instead. The f
4848
| kong_admin_password | KONG_ADMIN_PASSWORD | not set | Password for the kong admin api |
4949
| tls_skip_verify | TLS_SKIP_VERIFY | false | Whether to skip tls certificate verification for the kong api when using https |
5050
| kong_api_key | KONG_API_KEY | not set | API key used to secure the kong admin API |
51-
51+
| kong_admin_token | KONG_ADMIN_TOKEN | not set | API key used to secure the kong admin API in the Enterprise Edition |
5252

5353

5454

@@ -66,7 +66,7 @@ resource "kong_service" "service" {
6666
connect_timeout = 1000
6767
write_timeout = 2000
6868
read_timeout = 3000
69-
69+
7070
}
7171
```
7272
The service resource maps directly onto the json for the service endpoint in Kong. For more information on the parameters [see the Kong Service create documentation](https://getkong.org/docs/0.13.x/admin-api/#service-object).
@@ -345,7 +345,7 @@ returned:
345345
To look up an existing plugin:
346346
```hcl
347347
data "kong_plugin" "plugin_data_source" {
348-
filter = {
348+
filter = {
349349
id = "f0e656af-ad53-4622-ac73-ffd46ae05289"
350350
name = "response-ratelimiting"
351351
api_id = "51694bcd-3c72-43b3-b414-a09bbf4e3c30"
@@ -377,8 +377,8 @@ Each of the filter parameters are optional and they are combined for an AND sear
377377
* `name` - the name of the found upstream
378378
* `slots` - the number of slots on the found upstream
379379
* `order_list` - a list containing the slot order on the found upstream
380-
381-
380+
381+
382382
# Contributing
383383
I would love to get contributions to the project so please feel free to submit a PR. To setup your dev station you need go and docker installed.
384384

kong/provider.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ func Provider() terraform.ResourceProvider {
4141
DefaultFunc: envDefaultFuncWithDefault("KONG_API_KEY", ""),
4242
Description: "API key for the kong api (if you have locked it down)",
4343
},
44+
"kong_admin_token": &schema.Schema{
45+
Type: schema.TypeString,
46+
Optional: true,
47+
DefaultFunc: envDefaultFuncWithDefault("KONG_ADMIN_TOKEN", ""),
48+
Description: "API key for the kong api (Enterprise Edition)",
49+
},
4450
},
4551

4652
ResourcesMap: map[string]*schema.Resource{
@@ -88,6 +94,7 @@ func providerConfigure(d *schema.ResourceData) (interface{}, error) {
8894
Password: d.Get("kong_admin_password").(string),
8995
InsecureSkipVerify: d.Get("tls_skip_verify").(bool),
9096
ApiKey: d.Get("kong_api_key").(string),
97+
AdminToken: d.Get("kong_admin_token").(string),
9198
}
9299

93100
return gokong.NewClient(config), nil

vendor/github.com/kevholditch/gokong/README.md

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/kevholditch/gokong/client.go

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/kevholditch/gokong/request.go

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/vendor.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -535,10 +535,10 @@
535535
"revisionTime": "2016-08-03T19:07:31Z"
536536
},
537537
{
538-
"checksumSHA1": "OKYx2/l0+UmzGAPujUjF7pLttJk=",
538+
"checksumSHA1": "vwb6VmUskB2ZIvYzHEjQJjmK2pg=",
539539
"path": "github.com/kevholditch/gokong",
540-
"revision": "12fe723b6165789826227b5b7122385ade6173e5",
541-
"revisionTime": "2018-08-07T12:42:23Z"
540+
"revision": "f49a5c58889746cadb005f39f1a14bf510cd160d",
541+
"revisionTime": "2018-11-07T15:39:39Z"
542542
},
543543
{
544544
"path": "github.com/kevholditch/gokong...",

0 commit comments

Comments
 (0)