@@ -58,6 +58,7 @@ struct flb_out_kafka *flb_out_kafka_create(struct flb_output_instance *ins,
5858 return NULL ;
5959 }
6060
61+ #ifdef FLB_HAVE_AWS_MSK_IAM
6162 /*
6263 * When MSK IAM auth is enabled, default the required
6364 * security settings so users don't need to specify them.
@@ -78,12 +79,16 @@ struct flb_out_kafka *flb_out_kafka_create(struct flb_output_instance *ins,
7879 }
7980 }
8081 else {
82+ #endif
8183 /* Retrieve SASL mechanism if configured */
8284 tmp = flb_output_get_property ("rdkafka.sasl.mechanism" , ins );
8385 if (tmp ) {
8486 ctx -> sasl_mechanism = flb_sds_create (tmp );
8587 }
88+
89+ #ifdef FLB_HAVE_AWS_MSK_IAM
8690 }
91+ #endif
8792
8893 /* rdkafka config context */
8994 ctx -> conf = flb_kafka_conf_create (& ctx -> kafka , & ins -> properties , 0 );
@@ -205,6 +210,7 @@ struct flb_out_kafka *flb_out_kafka_create(struct flb_output_instance *ins,
205210 flb_kafka_opaque_set (ctx -> opaque , ctx , NULL );
206211 rd_kafka_conf_set_opaque (ctx -> conf , ctx -> opaque );
207212
213+ #ifdef FLB_HAVE_AWS_MSK_IAM
208214 if (ctx -> aws_msk_iam && ctx -> aws_msk_iam_cluster_arn && ctx -> sasl_mechanism &&
209215 strcasecmp (ctx -> sasl_mechanism , "OAUTHBEARER" ) == 0 ) {
210216
@@ -225,6 +231,7 @@ struct flb_out_kafka *flb_out_kafka_create(struct flb_output_instance *ins,
225231 }
226232 }
227233 }
234+ #endif
228235
229236 /* Kafka Producer */
230237 ctx -> kafka .rk = rd_kafka_new (RD_KAFKA_PRODUCER , ctx -> conf ,
@@ -315,9 +322,11 @@ int flb_out_kafka_destroy(struct flb_out_kafka *ctx)
315322 flb_sds_destroy (ctx -> gelf_fields .full_message_key );
316323 flb_sds_destroy (ctx -> gelf_fields .level_key );
317324
325+ #ifdef FLB_HAVE_AWS_MSK_IAM
318326 if (ctx -> msk_iam ) {
319327 flb_aws_msk_iam_destroy (ctx -> msk_iam );
320328 }
329+ #endif
321330
322331 flb_sds_destroy (ctx -> sasl_mechanism );
323332
0 commit comments