Terraform, credentials and Java Client

Hi there,

I created a Cluster manually before and connected a Java test harness to send messages to a Kafka topic. My property file looks as shown below

I am now trying to do the same except I am automating the environment, cluster, accounts with Terraform.

I managed to create the environment, the cluster and a service account. But not sure how to create the credentials to be able to run my Java test harness again.

Appreciate the support.


Hi Kris,

The Confluent Terraform Provider has a great set of example configurations, and hopefully you will find what you need in there in terms of creating API keys for service accounts.

For example, this block creates an API key for the app-consumer Service Account.

thanks Brett,

created a service account, role binding and API Key. Then output the results on the command line

terraform show -json terraform.tfstate > output.json

from which I extract the API Key id and secret. Need find a way eventually to pass this through code if I were to run this in a CICD tool. But for now this does the trick.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.