Created
January 14, 2026 17:09
-
-
Save PetrGlad/b5aeb0c9af25039187135c25f1fa477f to your computer and use it in GitHub Desktop.
AWS Kafka
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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=":" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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