The following creates a new Consumer Group called my_group:
_format_version: '3.0'
consumer_groups:
- name: my_group
To create a consumer group, call the Admin API’s /consumer_groups endpoint.
curl -X POST http://localhost:8001/consumer_groups/ \
--header "accept: application/json" \
--header "Content-Type: application/json" \
--data '
{
"name": "my_group"
}
'
To create a consumer group, call the Konnect control plane config API’s /consumer_groups endpoint.
curl -X POST https://{region}.api.konghq.com/v2/control-planes/{controlPlaneId}/core-entities/consumer_groups/ \
--header "accept: application/json" \
--header "Content-Type: application/json" \
--header "Authorization: Bearer $KONNECT_TOKEN" \
--data '
{
"name": "my_group"
}
'
Make sure to replace the following placeholders with your own values:
-
region
: Geographic region where your Kong Konnect is hosted and operates.
-
controlPlaneId
: The id
of the control plane.
-
KONNECT_TOKEN
: Your Personal Access Token (PAT) associated with your Konnect account.
See the Konnect API reference to learn about region-specific URLs and personal access tokens.
apiVersion: configuration.konghq.com/v1
kind: KongConsumerGroup
metadata:
name: { { include.presenter.data.name } }
annotations:
kubernetes.io/ingress.class: kong
Prerequisite: Configure your Personal Access Token
terraform {
required_providers {
konnect = {
source = "kong/konnect"
}
}
}
provider "konnect" {
personal_access_token = "$KONNECT_TOKEN"
server_url = "https://us.api.konghq.com/"
}
resource "konnect_gateway_consumer_group" "my_consumer_group" {
control_plane_id = konnect_gateway_control_plane.my_konnect_cp.id
}
The following creates a new Consumer Group called my_group:
- In Kong Manager or Gateway Manager, go to API Gateway > Consumers.
- Click Consumer Group.
- Click New Consumer Group.
- Enter the Name
my_group
.
- Click Save.