Skip to content

Instantly share code, notes, and snippets.

@PetrGlad
Created January 14, 2026 17:09
Show Gist options
  • Select an option

  • Save PetrGlad/b5aeb0c9af25039187135c25f1fa477f to your computer and use it in GitHub Desktop.

Select an option

Save PetrGlad/b5aeb0c9af25039187135c25f1fa477f to your computer and use it in GitHub Desktop.
AWS Kafka
security.protocol=SASL_SSL
sasl.mechanism=AWS_MSK_IAM
sasl.jaas.config=software.amazon.msk.auth.iam.IAMLoginModule required;
sasl.client.callback.handler.class=software.amazon.msk.auth.iam.IAMClientCallbackHandler
# Sample messages (keyed)
bin/kafka-console-consumer.sh \
--bootstrap-server <<BOOTSTRAP_SERVERS>> \
--consumer.config client.properties \
--topic <<TOPIC>> \
--property print.key=true \
--property key.separator=":"
# Kafka CLI download: https://kafka.apache.org/community/downloads/
# Auth module download
wget https://github.com/aws/aws-msk-iam-auth/releases/download/v1.1.9/aws-msk-iam-auth-1.1.9-all.jar
# sha256sum aws-msk-iam-auth-1.1.9-all.jar
# 16b3fbb2fbc7f0a5e60f2b8152b85c4892ed2459595a6400bc29126d98dcdf78 aws-msk-iam-auth-1.1.9-all.jar
export CLASSPATH=aws-msk-iam-auth-1.1.9-all.jar
aws kafka get-bootstrap-brokers --cluster-arn <<CLUSTER_ARN>> --query BootstrapBrokerStringSaslIam
# Send tombstone
echo "<<KEY>>:null" | bin/kafka-console-producer.sh \
--bootstrap-server <<BOOTSTRAP_SERVERS>> \
--producer.config client.properties \
--topic <<TOPIC_NAME>> --property "parse.key=true" --property key.separator=":" --property "null.marker=null"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment