Get temporary Kafka credentials ΒΆ

Use the nais-cli to get temporary credentials for Kafka. This is useful for debugging, running kafka-consumer-groups.sh, or connecting from outside Nais.

shell

where

  • <team> is the name of the team.
  • <environment> is the environment where Kafka runs (e.g. dev, prod).
  • <duration> is how long the credentials should be valid (e.g. 1d, 7d, max 365d).

The default output format is environment variables. Use --output to change format:

FormatDescription
envEnvironment variables (default)
kcatConfiguration file for kcat
javaJava properties file for kafka-console-consumer.sh and similar tools

The kcat and java formats write configuration files to a temporary directory and print the path.

The credentials expire automatically when the TTL runs out. To get fresh credentials, simply run the command again.