You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* starting work on Kong 1.0.0 compatibility
* global plugin test passing
* all plugin tests passing
* fixing upstream tests
* early version with all tests passing
* removing unsupported property
* make goimports
* make goimports
* updated readme
The Kong Terraform Provider tested against real Kong!
6
6
7
7
8
-
Notice
8
+
IMPORTANT
9
9
------
10
-
**CURRENTLY NOT COMPATIBLE WITH KONG 1.0.0 - Im working on support for it**
10
+
This provider now supports kong `v1.0.0` and onwards (from `v2.0.0` onwards of provider) Since the release of Kong `v1.0.0` has many breaking changes (e.g. removing APIs) this provider is
11
+
no longer compatible with version of kong pre v1.0.0. If you want to use the provider with versions of kong pre `v1.0.0` then please checkout branch `kong-pre-1.0.0` or
12
+
use a version of the provider `v1.9.1` or less.
11
13
12
-
I have recently updated the provider to use `v1.0.0` of [gokong](http://github.com/kevholditch/gokong) this pulls in the changes to use pointers to all api fields. If you update to the latest provider
13
-
be aware of this change. Terraform may want to update some api resources as this fixes a bug where if you set a string from a value to `""` it will now be treated as empty string and not ignored. If you
14
-
have set any of your api fields to empty string this will now be picked up.
14
+
Due to compatibility issues I have had to remove some of the properties on the resources. Most notability for a plugin you can only configure it using the `config_json` property
15
+
the `config` property has been removed. This is due to some internal changes that have been made to kong in `v1.0.0`.
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).
75
+
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/1.0.x/admin-api/#service-object).
The route resource maps directly onto the json for the route endpoint in Kong. For more information on the parameters [see the Kong Route create documentation](https://getkong.org/docs/0.13.x/admin-api/#route-object).
95
+
The route resource maps directly onto the json for the route endpoint in Kong. For more information on the parameters [see the Kong Route create documentation](https://getkong.org/docs/1.0.x/admin-api/#route-object).
The api resource maps directly onto the json for the API endpoint in Kong. For more information on the parameters [see the Kong Api create documentation](https://getkong.org/docs/0.13.x/admin-api/#api-object).
The `config_json` is passed through to the plugin to configure it as is. Note that the old `config` property has been removed due to incompatibility issues with kong v1.0.0.
116
+
Having the `config_json` property gives you ultimate flexibility to configure the plugin.
125
117
126
-
## Plugins
118
+
To apply a plugin to a consumer use the `consumer_id` property, for example:
127
119
```hcl
128
-
resource "kong_plugin" "response_rate_limiting" {
129
-
name = "response-ratelimiting"
130
-
config = {
131
-
limits.sms.minute = 10
132
-
}
120
+
resource "kong_consumer" "plugin_consumer" {
121
+
username = "PluginUser"
122
+
custom_id = "567"
133
123
}
134
-
```
135
-
136
-
The plugin resource maps directly onto the json for the API endpoint in Kong. For more information on the parameters [see the Kong Api create documentation](https://getkong.org/docs/0.13.x/admin-api/#plugin-object).
The plugin resource maps directly onto the json for the API endpoint in Kong. For more information on the parameters [see the Kong Api create documentation](https://getkong.org/docs/1.0.x/admin-api/#plugin-object).
Some plugins allow you to configure them for a specific consumer for example the [jwt](https://getkong.org/plugins/jwt/#create-a-jwt-credential) and [key-auth](https://getkong.org/plugins/key-authentication/#create-an-api-key) plugins.
179
189
To configure a plugin for a consumer this terraform provider provides a generic way to do this for all plugins the `kong_consumer_plugin_config` resource.
The consumer resource maps directly onto the json for creating an Consumer in Kong. For more information on the parameters [see the Kong Consumer create documentation](https://getkong.org/docs/0.13.x/admin-api/#consumer-object).
237
+
The consumer resource maps directly onto the json for creating an Consumer in Kong. For more information on the parameters [see the Kong Consumer create documentation](https://getkong.org/docs/1.0.x/admin-api/#consumer-object).
Each of the filter parameters are optional and they are combined for an AND search against all plugins. The following output parameters are returned:
359
-
360
-
*`id` - the Kong id of the found plugin
361
-
*`name` - the name of the found plugin
362
-
*`api_id` - the API id the found plugin is associated with (might be empty if not associated with an API)
363
-
*`consumer_id` - the consumer id the found plugin is associated with (might be empty if not associated with a consumer)
364
-
*`enabled` - whether the plugin is enabled
365
-
366
-
## Upstreams
367
-
To lookup an existing upstream:
368
-
```hcl
369
-
data "kong_upstream" "upstream_data_source" {
370
-
filter = {
371
-
id = "893a49a8-090f-421e-afce-ba70b02ce958"
372
-
name = "TestUpstream"
373
-
}
374
-
}
375
-
```
376
-
Each of the filter parameters are optional and they are combined for an AND search against all upstreams. The following output parameters are returned:
377
-
378
-
*`id` - the Kong id of the found upstream
379
-
*`name` - the name of the found upstream
380
-
*`slots` - the number of slots on the found upstream
381
-
*`order_list` - a list containing the slot order on the found upstream
382
-
383
-
384
292
# Contributing
385
293
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.
0 commit comments