How to set auto.create.topics.enable as default config on AWS MSK cluster

Update

You can now customise MSK configuration:

auto.create.topics.enable: Enables topic autocreation on the server.

Therefore, auto.create.topics.enable=true (defaults to false) should now do the trick as usual.


Older Answer

Although auto.create.topics.enable normally defaults to true, this is not the case for AWS MSK. According to these slides presented in Berlin's AWS Kafka Summit this February, the following are the default configuration parameters for Amazon MSK:

offsets.topic.replication.factor 3
transaction.state.log.replication.factor 3
transaction.state.log.min.isr 2
auto.create.topics.enable False
default.replication.factor 3
min.insync.replicas 2
unclean.leader.election.enable True
auto.leader.rebalance.enable True
authorizer.class.name kafka.security.auth.SimpleAclAuthorizer
group.initial.rebalance.delay.ms 3000
log.retention.hours 168 

Note that even Kafka docs mention that the suggested production configuration should be set to false. It also seems that this property is not configurable on MSK, so I would either suggest to get in touch with AWS support, or just live with it and create topics before running your producers.


Moving forward you can now set this parameter to true by customizing the configuration, however it will stay false by default since that is the recommended production configuration.