Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FR]: Add a managed Kafka module #2972

Open
Soviut opened this issue Mar 19, 2025 · 7 comments
Open

[FR]: Add a managed Kafka module #2972

Soviut opened this issue Mar 19, 2025 · 7 comments
Labels
enhancement New feature or request

Comments

@Soviut
Copy link

Soviut commented Mar 19, 2025

The feature request

Add a managed kafka module that can spin up both a Kafka cluster as well as a set of topics.

Proposed solution

A Kafka module would be able to spin up a cluster and a list of topics with as little configuration as possible.

Additional context

Having done it by hand using the google provider, it took me a long time because I had to figure out the convention for cluster paths that are required by the topic module.

@Soviut Soviut added the enhancement New feature or request label Mar 19, 2025
@ludoo
Copy link
Collaborator

ludoo commented Mar 19, 2025

I don't think we have the bandwidth for this, but you are welcome to send a PR.

@Soviut
Copy link
Author

Soviut commented Mar 19, 2025

@ludoo I could certainly clean up what I've done manually and submit a PR, but it wouldn't necessarily cover all aspects of the module it's wrapping. Is there a way that this can be iterated on as a "beta module"?

@ludoo
Copy link
Collaborator

ludoo commented Mar 19, 2025

Rather than a module, this might be one of our new blueprints, which reside under fast/project-templates. The idea is to write the project reqs as a YAML that can be either dropped in our project factory, or used as a reference. And use Terraform to populate resources within the project.

@ludoo
Copy link
Collaborator

ludoo commented Mar 19, 2025

This is a simple example. In your case the project template should also attach to a shared vpc, like we're doing in the template we're preparing for MongoDB.

@juliocc
Copy link
Collaborator

juliocc commented Mar 19, 2025

@ludoo I believe @Soviut is talking about this, which does look like a good candidate for a module.

@ludoo
Copy link
Collaborator

ludoo commented Mar 19, 2025

But that is a single resource...

@Soviut
Copy link
Author

Soviut commented Mar 19, 2025

@ludoo Here's the full example that I worked from. It includes the Kafka cluster resource and the topics resource.

https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/managed_kafka_cluster

My variables looked something like this

variable "project_id" {
  type        = string
  description = "The project ID."
}

variable "cluster_id" {
  type        = string
  description = "The cluster ID."
}

variable "location" {
  type        = string
  description = "The location."
  default     = "us-central1"
}

variable "subnet" {
  type        = string
  description = "The subnet used by the cluster."
}

variable "vcpu_count" {
  type        = number
  description = "The number of vCPUs."
  default     = 3
}

variable "memory_bytes" {
  type        = number
  description = "The memory in bytes to allocate to the instance."
  default     = 3221225472 # 3 GiB
}

variable "topics" {
  type = list(object({
    topic_id           = string
    partition_count    = optional(number, 3)
    replication_factor = optional(number, 1)
  }))
  description = "The list of topics."
  default     = []
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants