Create a Kafka Cluster on Confluent Cloud from a Template Using Pulumi¶
What is Pulumi?¶
Pulumi is an open source infrastructure-as-code tool that utilizes the most popular programming languages to simplify provisioning and managing cloud resources.
Why Pulumi and Kafka?¶
The Confluent Cloud provider for Pulumi is built on the official Create a Kafka Cluster on Confluent Cloud from a Template Using Terraform and enables programming Confluent Cloud by using popular languages like TypeScript, JavaScript, Python, Go, .NET, Java, and YAML.
Using the Confluent Cloud provider for Pulumi¶
The following code example shows how to provision a Confluent Cloud environment and a Kafka cluster by using C#.
public void CreateEnvironment(
string envName,
string clusterName)
{
EnvironmentArgs args = new()
{
DisplayName = envName
};
Pulumi.ConfluentCloud.Environment env = new(envName, args);
KafkaClusterEnvironmentArgs clusterEnvArgs = new()
{
Id = env.Id
};
KafkaClusterArgs clusterArgs = new()
{
Availability = "SINGLE_ZONE",
Basics = new KafkaClusterBasicArgs(),
Cloud = "AWS",
DisplayName = clusterName,
Environment = clusterEnvArgs,
Region = "us-west-2",
};
KafkaCluster cluster = new(clusterName, clusterArgs);
}
Resources you can manage in code¶
- API keys
- Connectors
- Confluent Cloud Environments
- Kafka ACLs
- Kafka clusters
- Kafka topics
- Networks
- Peering networks
- Private Link Access
- Role bindings
- Service accounts
Get started with Pulumi and install the Confluent Cloud provider for Pulumi.