This module creates and manages a Kafka-compatible serverless event streaming platform. Key features:

  • Event Hub namespace management with authorization rule
  • optional network rules configuration
  • Kafka topics (Event Hubs) management

NOTE: This module is meant to be used with an already created resource group

The module follows Azure naming conventions. Name variables passed to the module are only suffixes used in the full resource names that are defined by Azure standards

Abbreviations are used for resource names in most cases, based on these Azure recommendations

Log in to Corewide IaC registry

Once you have a Corewide Solutions Portal account, this one-time action will use your browser session to retrieve credentials:

 shellterraform login solutions.corewide.com
Provision instructions

Initialize mandatory providers:

Copy and paste into your Terraform configuration and insert the variables:

 hclmodule "tf_azure_eventhub_kafka" {
  source  = "solutions.corewide.com/azure/tf-azure-eventhub-kafka/azurerm"
  version = "~> 1.0.0"

  # specify module inputs here or try one of the examples below
  ...
}

Initialize the setup:

 shellterraform init
Define update strategy

Corewide DevOps team strictly follows Semantic Versioning Specification to provide our clients with products that have predictable upgrades between versions. We recommend pinning patch versions of our modules using pessimistic constraint operator (~>) to prevent breaking changes during upgrades.

To get new features during the upgrades (without breaking compatibility), use ~> 1.0 and run terraform init -upgrade

For the safest setup, use strict pinning with version = "1.0.0"

Kafka in Azure Event Hub

Creates a Kafka-compatible serverless event streaming platform
$450
BUY
v1.0.0 released 1 month, 4 weeks ago

This module creates and manages a Kafka-compatible serverless event streaming platform. Key features:

  • Event Hub namespace management with authorization rule
  • optional network rules configuration
  • Kafka topics (Event Hubs) management

NOTE: This module is meant to be used with an already created resource group

The module follows Azure naming conventions. Name variables passed to the module are only suffixes used in the full resource names that are defined by Azure standards

Abbreviations are used for resource names in most cases, based on these Azure recommendations

Create an Event Hub namespace with Event Hubs (Kafka topics), specified tier, access allowed from the specific subnet, and tags:

NOTE: subnet must have the Microsoft.EventHub service endpoint enabled

 hclresource "azurerm_resource_group" "foo" {
  name     = "foo"
  location = "eastus"
}

module "kafka" {
  source  = "solutions.corewide.com/azure/tf-azure-eventhub-kafka/azurerm"
  version = "~> 1.0"

  name_suffix         = "bar"
  region              = azurerm_resource_group.foo.location
  resource_group_name = azurerm_resource_group.foo.name
  tier                = "Premium"

  topics = [
    { name = "queue" },
    { name = "messages" },
  ]

  network_rules = {
    enabled               = true
    public_access_enabled = false
    allowed_subnet_ids    = ["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Network/virtualNetworks/myvnet1/subnets/mysubnet1"]
  }

  tags = {
    Layer = "Data"
  }
}

Minimal setup with required parameters only:

 hclresource "azurerm_resource_group" "foo" {
  name     = "foo"
  location = "eastus"
}

module "kafka" {
  source  = "solutions.corewide.com/azure/tf-azure-eventhub-kafka/azurerm"
  version = "~> 1.0"

  name_suffix         = "bar"
  region              = azurerm_resource_group.foo.location
  resource_group_name = azurerm_resource_group.foo.name
}
Variable Description Type Default Required Sensitive
name_suffix Name suffix for the managed Event Hub namespace string yes no
region Resource group location where resources should be created string yes no
resource_group_name The resource group name in which resources should be created string yes no
capacity The number of throughput units number 1 no no
network_rules Event Hub namespace network rules configuration object {} no no
network_rules.allowed_cidrs List of the CIDRs to allow access from list(string) [] no no
network_rules.allowed_subnet_ids List of the subnet IDs to allow access from list(string) [] no no
network_rules.enabled Toggle network rules of Event Hub namespace bool false no no
network_rules.public_access_enabled Toggle public network availability bool true no no
tags Tags to be applied to the Event Hub resources map(string) {} no no
tier The SKU tier of the Event Hub namespace. Possible values are: Standard and Premium string Standard no no
topics List of Kafka topics (Event Hubs) to create inside the Event Hub namespace list(object) [] no no
topics[*].message_retention The number of days to retain the events number 1 no no
topics[*].name Name of Kafka topic (Event Hub) string yes no
topics[*].partition_count The number of partitions (shards) for the topic number 3 no no
Output Description Type Sensitive
bootstrap_host Kafka bootstrap host computed no
bootstrap_port Kafka bootstrap port computed no
eventhub_auth_rule Event Hub namespace authorization rule attributes resource yes
eventhub_namespace Event Hub namespace attributes resource yes
topics Kafka topic (Event Hub) resources' attributes resource no
Dependency Version Kind
terraform >= 1.3 CLI
hashicorp/azurerm ~> 5.0 provider

Not sure where to start?
Let's find your perfect match.