Custom OPA host and portv2.4+

Configure the OPA plugin to connect to an OPA server with a custom host and port and get the /my_policies/header policy.

Prerequisites

  • OPA server running

Environment variables

  • OPA_HOST: The host of your OPA server.

Set up the plugin

Add this section to your kong.yaml configuration file:

kong.yaml
_format_version: "3.0"
plugins:
  - name: opa
    config:
      opa_host: ${{ env "DECK_OPA_HOST" }}
      opa_port: 8182
      opa_path: "/v1/data/my_policies/header"

Did this doc help?

Something wrong?

Help us make these docs great!

Kong Developer docs are open source. If you find these useful and want to make them better, contribute today!