Skip to content

Commit

Permalink
Add plugin resource docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Shawn Castrianni authored and Shawn Castrianni committed Jun 10, 2023
1 parent d828dce commit 40b142c
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
36 changes: 36 additions & 0 deletions docs/resources/plugin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
subcategory: "Runtime Configuration"
---
# Resource: konnect_plugin
Represents a plugin within a runtime group
## Example usage
```hcl
data "konnect_runtime_group" "RuntimeGroup" {
name = "TestRuntimeGroup"
}
resource "konnect_plugin" "example" {
runtime_group_id = data.konnect_runtime_group.RuntimeGroup.id
name = "rate-limiting"
config_json = <<EOF
{
"minute": 5
}
EOF
}
```
## Argument Reference
* `runtime_group_id` - **(Required, String)** The id of the runtime group.
* `name` - **(Required, String)** The name of the plugin which must match a valid installed plugin.
* `instance_name` - **(Optional, String)** The instance name of the plugin. Default: `-`
* `protocols` - **(Optional, List of String)** A list of the request protocols that will trigger this plugin. Allowed values: `grpc`, `grpcs`, `http`, `https`, `tcp`, `tls`, `tls_passthrough`, `udp`, `ws`, `wss`
* `enabled` - **(Optional, Boolean)** Whether the plugin is active. Default: `true`
* `config_json` - **(Optional, JSON)** The configuration properties for the plugin which can be found on the plugins documentation page in the [Kong Plugin Hub](https://docs.konghq.com/hub/)
* `service_id` - **(Optional, String)** If set, the plugin will only activate when receiving requests via one of the routes belonging to the specified service.
* `route_id` - **(Optional, String)** If set, the plugin will only activate when receiving requests via the specified route.
* `consumer_id` - **(Optional, String)** If set, the plugin will activate only for requests where the specified consumer has been authenticated.
## Attribute Reference
* `id` - **(String)** Same as `runtime_group_id`:`plugin_id`
* `plugin_id` - **(String)** Id of the plugin alone
* `config_all_json` - **(JSON)** The full configuration properties for the plugin, including all properties with their default values not specified in `config`.
## Import
Plugins can be imported using a proper value of `id` as described above
2 changes: 1 addition & 1 deletion docs/resources/service.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ resource "konnect_service" "example" {
* `connect_timeout` - **(Optional, Integer)** The timeout in milliseconds for establishing a connection to the host. Default: `60000`
* `read_timeout` - **(Optional, Integer)** The timeout in milliseconds between two successive read operations for transmitting a request to the host. Default: `60000`
* `write_timeout` - **(Optional, Integer)** The timeout in milliseconds between two successive write operations for transmitting a request to the host. Default: `60000`
* `enabled` - **(Optional, Boolean)** Whether the Service is active. Default: `true`
* `enabled` - **(Optional, Boolean)** Whether the service is active. Default: `true`
## Attribute Reference
* `id` - **(String)** Same as `runtime_group_id`:`service_id`
* `service_id` - **(String)** Id of the service alone
Expand Down

0 comments on commit 40b142c

Please sign in to comment.