Get Started with Client Quotas in Confluent Cloud

This section shows how to create, list, and delete Confluent Cloud Client Quotas using the Confluent CLI and the Confluent Cloud Console. For the full command reference, see confluent kafka quota. To make similar calls with a REST API, see the Client Quotas Reference.

Prerequisites:

  • Confluent CLI installed, and access to a Confluent Cloud administrator account.
  1. Sign in to your Confluent Cloud account, and create a Service Account by running the following command:

    confluent iam service-account create client-quota-SA --description "Client Quotas demo SA"
    
  2. Create a quota, specifying a quota name, the cluster where the quota is applied, values for ingress and egress and the principal ID. Ingress and egress values are specified in bytes. Use values of at least 1 MB (1,000,000 bytes) or higher. Consider the following examples.

    For example, creating a quota with a service account principal:

    confluent kafka quota create --name test-quota --cluster lkc-12345 \
                                --ingress 1000000 --egress 1000000 --description "Test Quota" \
                                --principals sa-12345
    

    For example, creating a quota with an identity pool principal:

    confluent kafka quota create --name test-quota --cluster lkc-12345 \
                                --ingress 1000000 --egress 1000000 --description "Test Quota" \
                                --principals pool-abcde
    

    For example, creating a quota with identity pool and service account principals:

    confluent kafka quota create --name test-quota --cluster lkc-12345 \
                                --ingress 1000000 --egress 1000000 --description "Test Quota" \
                                --principals pool-abcde sa-12345
    

    The result should look similar to the following:

    +--------------+-------------+
    | ID           | cq-abcde    |
    | Display Name | test-quota  |
    | Description  | Test Quota  |
    | Ingress      | 1000000 B/s |
    | Egress       | 1000000 B/s |
    | Cluster      | lkc-12345   |
    | Principals   | sa-12345    |
    +--------------+-------------+
    
  3. You can modify your quota later. For example, to add or remove principals, use the update command:

    confluent kafka quota update cq-abcde --add-principals sa-12345
    confluent kafka quota update cq-abcde --remove-principals sa-12345
    
  4. Finally, you can retrieve a list of quota IDs with the list command, and use delete to delete the the sample quota you created:

    confluent kafka quota list --cluster lkc-12345
    confluent kafka quota delete cq-abcde --cluster lkc-12345