Add this section to your kong.yaml configuration file:
_format_version: "3.0"
plugins:
- name: acme
config:
account_email: ${{ env "DECK_EMAIL" }}
account_key:
key_id: ${{ env "DECK_KEY_ID" }}
key_set: ${{ env "DECK_KEY_SET" }}
domains:
- ${{ env "DECK_DOMAIN" }}
tos_accepted: true
storage: redis
storage_config:
redis:
host: ${{ env "DECK_INSTANCE_ADDRESS" }}
username: ${{ env "DECK_INSTANCE_USERNAME" }}
port: 6379
cloud_authentication:
auth_provider: aws
aws_cache_name: ${{ env "DECK_AWS_CACHE_NAME" }}
aws_is_serverless: false
aws_region: ${{ env "DECK_AWS_REGION" }}
aws_access_key_id: ${{ env "DECK_AWS_ACCESS_KEY_ID" }}
aws_secret_access_key: ${{ env "DECK_AWS_ACCESS_SECRET_KEY" }}
Make the following request:
curl -i -X POST http://localhost:8001/plugins/ \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--data '
{
"name": "acme",
"config": {
"account_email": "'$EMAIL'",
"account_key": {
"key_id": "'$KEY_ID'",
"key_set": "'$KEY_SET'"
},
"domains": [
"'$DOMAIN'"
],
"tos_accepted": true,
"storage": "redis",
"storage_config": {
"redis": {
"host": "'$INSTANCE_ADDRESS'",
"username": "'$INSTANCE_USERNAME'",
"port": 6379,
"cloud_authentication": {
"auth_provider": "aws",
"aws_cache_name": "'$AWS_CACHE_NAME'",
"aws_is_serverless": false,
"aws_region": "'$AWS_REGION'",
"aws_access_key_id": "'$AWS_ACCESS_KEY_ID'",
"aws_secret_access_key": "'$AWS_ACCESS_SECRET_KEY'"
}
}
}
},
"tags": []
}
'
Make the following request:
curl -X POST https://{region}.api.konghq.com/v2/control-planes/{controlPlaneId}/core-entities/plugins/ \
--header "accept: application/json" \
--header "Content-Type: application/json" \
--header "Authorization: Bearer $KONNECT_TOKEN" \
--data '
{
"name": "acme",
"config": {
"account_email": "'$EMAIL'",
"account_key": {
"key_id": "'$KEY_ID'",
"key_set": "'$KEY_SET'"
},
"domains": [
"'$DOMAIN'"
],
"tos_accepted": true,
"storage": "redis",
"storage_config": {
"redis": {
"host": "'$INSTANCE_ADDRESS'",
"username": "'$INSTANCE_USERNAME'",
"port": 6379,
"cloud_authentication": {
"auth_provider": "aws",
"aws_cache_name": "'$AWS_CACHE_NAME'",
"aws_is_serverless": false,
"aws_region": "'$AWS_REGION'",
"aws_access_key_id": "'$AWS_ACCESS_KEY_ID'",
"aws_secret_access_key": "'$AWS_ACCESS_SECRET_KEY'"
}
}
}
},
"tags": []
}
'
Make sure to replace the following placeholders with your own values:
-
region: Geographic region where your Kong Konnect is hosted and operates.
-
KONNECT_TOKEN: Your Personal Access Token (PAT) associated with your Konnect account.
-
controlPlaneId: The id of the control plane.
See the Konnect API reference to learn about region-specific URLs and personal access tokens.
echo "
apiVersion: configuration.konghq.com/v1
kind: KongClusterPlugin
metadata:
name: acme
namespace: kong
annotations:
kubernetes.io/ingress.class: kong
konghq.com/tags: ''
labels:
global: 'true'
config:
account_email: '$EMAIL'
account_key:
key_id: '$KEY_ID'
key_set: '$KEY_SET'
domains:
- '$DOMAIN'
tos_accepted: true
storage: redis
storage_config:
redis:
host: '$INSTANCE_ADDRESS'
username: '$INSTANCE_USERNAME'
port: 6379
cloud_authentication:
auth_provider: aws
aws_cache_name: '$AWS_CACHE_NAME'
aws_is_serverless: false
aws_region: '$AWS_REGION'
aws_access_key_id: '$AWS_ACCESS_KEY_ID'
aws_secret_access_key: '$AWS_ACCESS_SECRET_KEY'
plugin: acme
" | kubectl apply -f -
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/"
}
Add the following to your Terraform configuration to create a Konnect Gateway Plugin:
resource "konnect_gateway_plugin_acme" "my_acme" {
enabled = true
config = {
account_email = var.email
account_key = {
key_id = var.key_id
key_set = var.key_set
}
domains = [var.domain]
tos_accepted = true
storage = "redis"
storage_config = {
redis = {
host = var.instance_address
username = var.instance_username
port = 6379
cloud_authentication = {
auth_provider = "aws"
aws_cache_name = var.aws_cache_name
aws_is_serverless = false
aws_region = var.aws_region
aws_access_key_id = var.aws_access_key_id
aws_secret_access_key = var.aws_access_secret_key
}
}
}
}
tags = []
control_plane_id = konnect_gateway_control_plane.my_konnect_cp.id
}
This example requires the following variables to be added to your manifest. You can specify values at runtime by setting TF_VAR_name=value.
variable "aws_access_secret_key" {
type = string
}