diff --git a/0_core-infrastructure/README.md b/0_core-infrastructure/README.md index 50cc7c3..819ea3f 100644 --- a/0_core-infrastructure/README.md +++ b/0_core-infrastructure/README.md @@ -24,7 +24,7 @@ Last updated: 2026-02-09
- Total views -

Refresh Date: 2026-02-12

+ Total views +

Refresh Date: 2026-02-16

diff --git a/0_core-infrastructure/azure-bastion/README.md b/0_core-infrastructure/azure-bastion/README.md index c000d16..988877b 100644 --- a/0_core-infrastructure/azure-bastion/README.md +++ b/0_core-infrastructure/azure-bastion/README.md @@ -45,7 +45,7 @@ Below is a list of variables used in this template, their expected values, types
- Total views -

Refresh Date: 2026-02-12

+ Total views +

Refresh Date: 2026-02-16

diff --git a/0_core-infrastructure/azure-dns/README.md b/0_core-infrastructure/azure-dns/README.md index 9c59f09..498fc52 100644 --- a/0_core-infrastructure/azure-dns/README.md +++ b/0_core-infrastructure/azure-dns/README.md @@ -40,7 +40,7 @@ Below is a list of variables used in this template, their expected values, types
- Total views -

Refresh Date: 2026-02-12

+ Total views +

Refresh Date: 2026-02-16

diff --git a/0_core-infrastructure/network-security-group/README.md b/0_core-infrastructure/network-security-group/README.md index 59ae6d8..3db0728 100644 --- a/0_core-infrastructure/network-security-group/README.md +++ b/0_core-infrastructure/network-security-group/README.md @@ -40,7 +40,7 @@ Below is a list of variables used in this template, their expected values, types
- Total views -

Refresh Date: 2026-02-12

+ Total views +

Refresh Date: 2026-02-16

diff --git a/0_core-infrastructure/public-ip/README.md b/0_core-infrastructure/public-ip/README.md index fa55469..b1e2206 100644 --- a/0_core-infrastructure/public-ip/README.md +++ b/0_core-infrastructure/public-ip/README.md @@ -42,7 +42,7 @@ Below is a list of variables used in this template, their expected values, types
- Total views -

Refresh Date: 2026-02-12

+ Total views +

Refresh Date: 2026-02-16

diff --git a/0_core-infrastructure/resource-group/README.md b/0_core-infrastructure/resource-group/README.md index 63ba4d1..82db997 100644 --- a/0_core-infrastructure/resource-group/README.md +++ b/0_core-infrastructure/resource-group/README.md @@ -33,7 +33,7 @@ Below is a list of variables used in this template, their expected values, types
- Total views -

Refresh Date: 2026-02-12

+ Total views +

Refresh Date: 2026-02-16

diff --git a/0_core-infrastructure/subnet/README.md b/0_core-infrastructure/subnet/README.md index abce34e..59cda00 100644 --- a/0_core-infrastructure/subnet/README.md +++ b/0_core-infrastructure/subnet/README.md @@ -43,7 +43,7 @@ Below is a list of variables used in this template, their expected values, types
- Total views -

Refresh Date: 2026-02-12

+ Total views +

Refresh Date: 2026-02-16

diff --git a/0_core-infrastructure/virtual-network/README.md b/0_core-infrastructure/virtual-network/README.md index 06e6f8b..9389e20 100644 --- a/0_core-infrastructure/virtual-network/README.md +++ b/0_core-infrastructure/virtual-network/README.md @@ -41,7 +41,7 @@ Below is a list of variables used in this template, their expected values, types
- Total views -

Refresh Date: 2026-02-12

+ Total views +

Refresh Date: 2026-02-16

diff --git a/10_migration-backup/README.md b/10_migration-backup/README.md index 730ec13..d964047 100644 --- a/10_migration-backup/README.md +++ b/10_migration-backup/README.md @@ -19,7 +19,7 @@ Last updated: 2026-02-09
- Total views -

Refresh Date: 2026-02-12

+ Total views +

Refresh Date: 2026-02-16

diff --git a/10_migration-backup/backup/README.md b/10_migration-backup/backup/README.md index cfc9bcf..ba7e8dd 100644 --- a/10_migration-backup/backup/README.md +++ b/10_migration-backup/backup/README.md @@ -52,7 +52,7 @@ terraform apply
- Total views -

Refresh Date: 2026-02-12

+ Total views +

Refresh Date: 2026-02-16

diff --git a/10_migration-backup/site-recovery/README.md b/10_migration-backup/site-recovery/README.md index 1568ee7..da62721 100644 --- a/10_migration-backup/site-recovery/README.md +++ b/10_migration-backup/site-recovery/README.md @@ -52,7 +52,7 @@ terraform apply
- Total views -

Refresh Date: 2026-02-12

+ Total views +

Refresh Date: 2026-02-16

diff --git a/11_media-services/README.md b/11_media-services/README.md index 5c28713..8e09a40 100644 --- a/11_media-services/README.md +++ b/11_media-services/README.md @@ -19,7 +19,7 @@ Last updated: 2026-02-11
- Total views -

Refresh Date: 2026-02-12

+ Total views +

Refresh Date: 2026-02-16

diff --git a/11_media-services/ai-video-indexer/README.md b/11_media-services/ai-video-indexer/README.md index 0851236..f901318 100644 --- a/11_media-services/ai-video-indexer/README.md +++ b/11_media-services/ai-video-indexer/README.md @@ -78,7 +78,7 @@ Last updated: 2026-02-10
- Total views -

Refresh Date: 2026-02-12

+ Total views +

Refresh Date: 2026-02-16

diff --git a/11_media-services/cdn/README.md b/11_media-services/cdn/README.md index 322b528..66ed946 100644 --- a/11_media-services/cdn/README.md +++ b/11_media-services/cdn/README.md @@ -85,7 +85,7 @@ Last updated: 2026-02-10
- Total views -

Refresh Date: 2026-02-12

+ Total views +

Refresh Date: 2026-02-16

diff --git a/1_storage-databases/README.md b/1_storage-databases/README.md index 0b0e9f6..1e97e27 100644 --- a/1_storage-databases/README.md +++ b/1_storage-databases/README.md @@ -26,7 +26,7 @@ Last updated: 2026-02-09
- Total views -

Refresh Date: 2026-02-12

+ Total views +

Refresh Date: 2026-02-16

diff --git a/1_storage-databases/blob-storage/README.md b/1_storage-databases/blob-storage/README.md index 720eef9..d88e701 100644 --- a/1_storage-databases/blob-storage/README.md +++ b/1_storage-databases/blob-storage/README.md @@ -45,7 +45,7 @@ Below is a list of variables used in this template, their expected values, types
- Total views -

Refresh Date: 2026-02-12

+ Total views +

Refresh Date: 2026-02-16

diff --git a/1_storage-databases/cosmos-db/README.md b/1_storage-databases/cosmos-db/README.md index d5b4ec8..682fa09 100644 --- a/1_storage-databases/cosmos-db/README.md +++ b/1_storage-databases/cosmos-db/README.md @@ -40,7 +40,7 @@ Below is a list of variables used in this template, their expected values, types
- Total views -

Refresh Date: 2026-02-12

+ Total views +

Refresh Date: 2026-02-16

diff --git a/1_storage-databases/data-lake-storage/README.md b/1_storage-databases/data-lake-storage/README.md index 655079c..b5b618d 100644 --- a/1_storage-databases/data-lake-storage/README.md +++ b/1_storage-databases/data-lake-storage/README.md @@ -42,7 +42,7 @@ Below is a list of variables used in this template, their expected values, types
- Total views -

Refresh Date: 2026-02-12

+ Total views +

Refresh Date: 2026-02-16

diff --git a/1_storage-databases/file-storage/README.md b/1_storage-databases/file-storage/README.md index 350a07b..b13b41f 100644 --- a/1_storage-databases/file-storage/README.md +++ b/1_storage-databases/file-storage/README.md @@ -44,7 +44,7 @@ Below is a list of variables used in this template, their expected values, types
- Total views -

Refresh Date: 2026-02-12

+ Total views +

Refresh Date: 2026-02-16

diff --git a/1_storage-databases/mongo-atlas/README.md b/1_storage-databases/mongo-atlas/README.md index 5da541e..1cdfd0e 100644 --- a/1_storage-databases/mongo-atlas/README.md +++ b/1_storage-databases/mongo-atlas/README.md @@ -133,7 +133,7 @@ Below is a list of variables used in this template, their expected values, types
- Total views -

Refresh Date: 2026-02-12

+ Total views +

Refresh Date: 2026-02-16

diff --git a/1_storage-databases/mongo-atlas/known_errors.md b/1_storage-databases/mongo-atlas/known_errors.md index fd426b4..674fc30 100644 --- a/1_storage-databases/mongo-atlas/known_errors.md +++ b/1_storage-databases/mongo-atlas/known_errors.md @@ -62,7 +62,7 @@ Last updated: 2026-02-09
- Total views -

Refresh Date: 2026-02-12

+ Total views +

Refresh Date: 2026-02-16

diff --git a/1_storage-databases/mysql-flexible-server/README.md b/1_storage-databases/mysql-flexible-server/README.md index 8fff7e0..044c4d4 100644 --- a/1_storage-databases/mysql-flexible-server/README.md +++ b/1_storage-databases/mysql-flexible-server/README.md @@ -49,7 +49,7 @@ Below is a list of variables used in this template, their expected values, types
- Total views -

Refresh Date: 2026-02-12

+ Total views +

Refresh Date: 2026-02-16

diff --git a/1_storage-databases/postgresql/README.md b/1_storage-databases/postgresql/README.md index cfa9b4d..660c956 100644 --- a/1_storage-databases/postgresql/README.md +++ b/1_storage-databases/postgresql/README.md @@ -48,7 +48,7 @@ Below is a list of variables used in this template, their expected values, types
- Total views -

Refresh Date: 2026-02-12

+ Total views +

Refresh Date: 2026-02-16

diff --git a/1_storage-databases/sql-database/README.md b/1_storage-databases/sql-database/README.md index bb9e14b..8a27d57 100644 --- a/1_storage-databases/sql-database/README.md +++ b/1_storage-databases/sql-database/README.md @@ -44,7 +44,7 @@ Below is a list of variables used in this template, their expected values, types
- Total views -

Refresh Date: 2026-02-12

+ Total views +

Refresh Date: 2026-02-16

diff --git a/1_storage-databases/storage-account/README.md b/1_storage-databases/storage-account/README.md index a99e090..375ff77 100644 --- a/1_storage-databases/storage-account/README.md +++ b/1_storage-databases/storage-account/README.md @@ -42,7 +42,7 @@ Below is a list of variables used in this template, their expected values, types
- Total views -

Refresh Date: 2026-02-12

+ Total views +

Refresh Date: 2026-02-16

diff --git a/2_compute-containers/README.md b/2_compute-containers/README.md index 2176a59..cb6793d 100644 --- a/2_compute-containers/README.md +++ b/2_compute-containers/README.md @@ -24,7 +24,7 @@ Last updated: 2026-02-09
- Total views -

Refresh Date: 2026-02-12

+ Total views +

Refresh Date: 2026-02-16

diff --git a/2_compute-containers/app-service/README.md b/2_compute-containers/app-service/README.md index 198045f..b8a003b 100644 --- a/2_compute-containers/app-service/README.md +++ b/2_compute-containers/app-service/README.md @@ -43,7 +43,7 @@ Below is a list of variables used in this template, their expected values, types
- Total views -

Refresh Date: 2026-02-12

+ Total views +

Refresh Date: 2026-02-16

diff --git a/2_compute-containers/batch/README.md b/2_compute-containers/batch/README.md index 58641f3..abcb567 100644 --- a/2_compute-containers/batch/README.md +++ b/2_compute-containers/batch/README.md @@ -40,7 +40,7 @@ Below is a list of variables used in this template, their expected values, types
- Total views -

Refresh Date: 2026-02-12

+ Total views +

Refresh Date: 2026-02-16

diff --git a/2_compute-containers/container-instances/README.md b/2_compute-containers/container-instances/README.md index 078adc5..c77efc4 100644 --- a/2_compute-containers/container-instances/README.md +++ b/2_compute-containers/container-instances/README.md @@ -45,7 +45,7 @@ Below is a list of variables used in this template, their expected values, types
- Total views -

Refresh Date: 2026-02-12

+ Total views +

Refresh Date: 2026-02-16

diff --git a/2_compute-containers/function-app/README.md b/2_compute-containers/function-app/README.md index 46c5963..1bbd8e3 100644 --- a/2_compute-containers/function-app/README.md +++ b/2_compute-containers/function-app/README.md @@ -43,7 +43,7 @@ Below is a list of variables used in this template, their expected values, types
- Total views -

Refresh Date: 2026-02-12

+ Total views +

Refresh Date: 2026-02-16

diff --git a/2_compute-containers/kubernetes-service/README.md b/2_compute-containers/kubernetes-service/README.md index e8db7d5..079e2c8 100644 --- a/2_compute-containers/kubernetes-service/README.md +++ b/2_compute-containers/kubernetes-service/README.md @@ -50,7 +50,7 @@ Below is a list of variables used in this template, their expected values, types
- Total views -

Refresh Date: 2026-02-12

+ Total views +

Refresh Date: 2026-02-16

diff --git a/2_compute-containers/virtual-desktop/README.md b/2_compute-containers/virtual-desktop/README.md index 12d53a7..8de4801 100644 --- a/2_compute-containers/virtual-desktop/README.md +++ b/2_compute-containers/virtual-desktop/README.md @@ -46,7 +46,7 @@ Below is a list of variables used in this template, their expected values, types
- Total views -

Refresh Date: 2026-02-12

+ Total views +

Refresh Date: 2026-02-16

diff --git a/2_compute-containers/virtual-machine/README.md b/2_compute-containers/virtual-machine/README.md index 1329e59..05d2450 100644 --- a/2_compute-containers/virtual-machine/README.md +++ b/2_compute-containers/virtual-machine/README.md @@ -45,7 +45,7 @@ Below is a list of variables used in this template, their expected values, types
- Total views -

Refresh Date: 2026-02-12

+ Total views +

Refresh Date: 2026-02-16

diff --git a/3_networking/README.md b/3_networking/README.md index a7d3f0e..b8f04e2 100644 --- a/3_networking/README.md +++ b/3_networking/README.md @@ -25,7 +25,7 @@ Last updated: 2026-02-09
- Total views -

Refresh Date: 2026-02-12

+ Total views +

Refresh Date: 2026-02-16

diff --git a/3_networking/application-gateway/README.md b/3_networking/application-gateway/README.md index 554d172..91e9ea5 100644 --- a/3_networking/application-gateway/README.md +++ b/3_networking/application-gateway/README.md @@ -65,7 +65,7 @@ terraform apply
- Total views -

Refresh Date: 2026-02-12

+ Total views +

Refresh Date: 2026-02-16

diff --git a/3_networking/cdn/README.md b/3_networking/cdn/README.md index bc354d7..e233d6b 100644 --- a/3_networking/cdn/README.md +++ b/3_networking/cdn/README.md @@ -57,7 +57,7 @@ terraform apply
- Total views -

Refresh Date: 2026-02-12

+ Total views +

Refresh Date: 2026-02-16

diff --git a/3_networking/expressroute/README.md b/3_networking/expressroute/README.md index 578339b..fc55660 100644 --- a/3_networking/expressroute/README.md +++ b/3_networking/expressroute/README.md @@ -60,7 +60,7 @@ terraform apply
- Total views -

Refresh Date: 2026-02-12

+ Total views +

Refresh Date: 2026-02-16

diff --git a/3_networking/firewall/README.md b/3_networking/firewall/README.md index 7e8a5ba..de18527 100644 --- a/3_networking/firewall/README.md +++ b/3_networking/firewall/README.md @@ -56,7 +56,7 @@ terraform apply
- Total views -

Refresh Date: 2026-02-12

+ Total views +

Refresh Date: 2026-02-16

diff --git a/3_networking/front-door/README.md b/3_networking/front-door/README.md index a87cbb6..48b170e 100644 --- a/3_networking/front-door/README.md +++ b/3_networking/front-door/README.md @@ -58,7 +58,7 @@ terraform apply
- Total views -

Refresh Date: 2026-02-12

+ Total views +

Refresh Date: 2026-02-16

diff --git a/3_networking/load-balancer/README.md b/3_networking/load-balancer/README.md index c10601d..199e1d7 100644 --- a/3_networking/load-balancer/README.md +++ b/3_networking/load-balancer/README.md @@ -71,7 +71,7 @@ terraform apply
- Total views -

Refresh Date: 2026-02-12

+ Total views +

Refresh Date: 2026-02-16

diff --git a/3_networking/traffic-manager/README.md b/3_networking/traffic-manager/README.md index eec8f42..41e0778 100644 --- a/3_networking/traffic-manager/README.md +++ b/3_networking/traffic-manager/README.md @@ -63,7 +63,7 @@ terraform apply
- Total views -

Refresh Date: 2026-02-12

+ Total views +

Refresh Date: 2026-02-16

diff --git a/3_networking/vpn-gateway/README.md b/3_networking/vpn-gateway/README.md index 9683a50..e218152 100644 --- a/3_networking/vpn-gateway/README.md +++ b/3_networking/vpn-gateway/README.md @@ -57,7 +57,7 @@ terraform apply
- Total views -

Refresh Date: 2026-02-12

+ Total views +

Refresh Date: 2026-02-16

diff --git a/4_identity-security/README.md b/4_identity-security/README.md index 909c1a2..59293b3 100644 --- a/4_identity-security/README.md +++ b/4_identity-security/README.md @@ -21,7 +21,7 @@ Last updated: 2026-02-09
- Total views -

Refresh Date: 2026-02-12

+ Total views +

Refresh Date: 2026-02-16

diff --git a/4_identity-security/entra_id/README.md b/4_identity-security/entra_id/README.md index 0915f39..a3c8ab1 100644 --- a/4_identity-security/entra_id/README.md +++ b/4_identity-security/entra_id/README.md @@ -74,7 +74,7 @@ Below is a list of variables used in this template, their expected values, types
- Total views -

Refresh Date: 2026-02-12

+ Total views +

Refresh Date: 2026-02-16

diff --git a/4_identity-security/key-vault/README.md b/4_identity-security/key-vault/README.md index 316817e..e01c317 100644 --- a/4_identity-security/key-vault/README.md +++ b/4_identity-security/key-vault/README.md @@ -91,7 +91,7 @@ Below is a list of variables used in this template, their expected values, types
- Total views -

Refresh Date: 2026-02-12

+ Total views +

Refresh Date: 2026-02-16

diff --git a/4_identity-security/managed-identity/README.md b/4_identity-security/managed-identity/README.md index 67d70ba..96f50d6 100644 --- a/4_identity-security/managed-identity/README.md +++ b/4_identity-security/managed-identity/README.md @@ -74,7 +74,7 @@ Last updated: 2026-02-09
- Total views -

Refresh Date: 2026-02-12

+ Total views +

Refresh Date: 2026-02-16

diff --git a/4_identity-security/policy/README.md b/4_identity-security/policy/README.md index 65f2d00..46eca67 100644 --- a/4_identity-security/policy/README.md +++ b/4_identity-security/policy/README.md @@ -86,7 +86,7 @@ Last updated: 2026-02-10
- Total views -

Refresh Date: 2026-02-12

+ Total views +

Refresh Date: 2026-02-16

diff --git a/5_analytics-bigdata/README.md b/5_analytics-bigdata/README.md index 1a9cbad..bf7179a 100644 --- a/5_analytics-bigdata/README.md +++ b/5_analytics-bigdata/README.md @@ -20,7 +20,7 @@ Last updated: 2026-02-12
- Total views -

Refresh Date: 2026-02-12

+ Total views +

Refresh Date: 2026-02-16

diff --git a/5_analytics-bigdata/data-factory/README.md b/5_analytics-bigdata/data-factory/README.md index 53f7f65..218b8fc 100644 --- a/5_analytics-bigdata/data-factory/README.md +++ b/5_analytics-bigdata/data-factory/README.md @@ -83,7 +83,7 @@ Last updated: 2026-02-11
- Total views -

Refresh Date: 2026-02-12

+ Total views +

Refresh Date: 2026-02-16

diff --git a/5_analytics-bigdata/databricks/README.md b/5_analytics-bigdata/databricks/README.md index 9f8465a..0c4a346 100644 --- a/5_analytics-bigdata/databricks/README.md +++ b/5_analytics-bigdata/databricks/README.md @@ -81,7 +81,7 @@ Last updated: 2026-02-12
- Total views -

Refresh Date: 2026-02-12

+ Total views +

Refresh Date: 2026-02-16

diff --git a/5_analytics-bigdata/event-hub/README.md b/5_analytics-bigdata/event-hub/README.md new file mode 100644 index 0000000..63462c0 --- /dev/null +++ b/5_analytics-bigdata/event-hub/README.md @@ -0,0 +1,80 @@ +# Terraform Template - Azure Event Hubs + +Costa Rica + +[![GitHub](https://img.shields.io/badge/--181717?logo=github&logoColor=ffffff)](https://github.com/) +[brown9804](https://github.com/brown9804) + +Last updated: 2026-02-16 + +------------------------------------------ + +> This template contains Terraform configurations to create an Azure Event Hubs namespace and an Event Hub (optionally with consumer groups). + +> [!NOTE] +> +> - The Resource Group is created via the AzAPI provider (management plane) to keep creation idempotent (ARM PUT) and align with other templates in this repository. +> - Event Hubs namespace names are globally unique. Keeping `append_random_suffix = true` helps avoid collisions. + +
+ image +
+ +
+ image +
+ +## File Descriptions + +- **main.tf**: Creates the Resource Group, Event Hubs Namespace, Event Hub, and optional consumer groups. +- **variables.tf**: Defines the input variables used in the Terraform configuration. +- **provider.tf**: Configures the AzureRM + AzAPI providers. +- **terraform.tfvars**: Example values for the variables defined in `variables.tf`. +- **output.tf**: Defines outputs such as namespace and Event Hub IDs. + +## Variables + +| Variable Name | Description | Type | Example Value | +| --- | --- | --- | --- | +| `resource_group_name` | Resource Group name to create/deploy into. | string | `"rg-analytics-dev-EH"` | +| `location` | Azure region for the deployment. | string | `"eastus"` | +| `eventhub_namespace_name` | Base namespace name. If suffix enabled, final is `-`. | string | `"ehns-analytics-dev"` | +| `eventhub_name` | Event Hub name inside the namespace. | string | `"events"` | +| `sku` | Namespace SKU (`Basic`, `Standard`, `Premium`). | string | `"Standard"` | +| `capacity` | Namespace capacity (ignored for `Basic`). | number | `1` | +| `partition_count` | Event Hub partitions. | number | `2` | +| `message_retention` | Retention in days. | number | `1` | +| `consumer_group_names` | Optional consumer groups to create. | list(string) | `["cg-default"]` | +| `append_random_suffix` | Append a random suffix to avoid collisions. | bool | `true` | +| `random_suffix_length` | Length of the random suffix when enabled. | number | `6` | +| `tags` | Tags applied to resources. | map(string) | `{ "env": "dev" }` | + +## Usage + +1. Authenticate: + + ```sh + az login + az account show + # If needed: + az account set --subscription "" + ``` + +2. Initialize: + + ```sh + terraform init -upgrade + ``` + +3. Validate and plan: + + ```sh + terraform validate + terraform plan + ``` + +4. Apply: + + ```sh + terraform apply -auto-approve + ``` diff --git a/5_analytics-bigdata/event-hub/main.tf b/5_analytics-bigdata/event-hub/main.tf new file mode 100644 index 0000000..7f64703 --- /dev/null +++ b/5_analytics-bigdata/event-hub/main.tf @@ -0,0 +1,79 @@ +data "azurerm_client_config" "current" {} + +# Resource group creation is idempotent in ARM (PUT). This will create the RG if it doesn't exist, +# or update tags if it already exists. +resource "azapi_resource" "resource_group" { + type = "Microsoft.Resources/resourceGroups@2022-09-01" + name = var.resource_group_name + location = var.location + parent_id = "/subscriptions/${data.azurerm_client_config.current.subscription_id}" + + body = jsonencode({ + tags = var.tags + }) + + response_export_values = [ + "id", + "name" + ] +} + +resource "random_string" "suffix" { + length = var.random_suffix_length + upper = false + special = false + numeric = true + + keepers = { + resource_group_name = var.resource_group_name + location = var.location + namespace_base = var.eventhub_namespace_name + eventhub_name = var.eventhub_name + sku = var.sku + capacity = tostring(var.capacity) + } +} + +locals { + suffix = var.append_random_suffix ? random_string.suffix.result : "" + + namespace_name = var.append_random_suffix ? "${var.eventhub_namespace_name}-${local.suffix}" : var.eventhub_namespace_name + namespace_capacity = var.sku == "Basic" ? null : var.capacity +} + +resource "azurerm_eventhub_namespace" "ns" { + name = local.namespace_name + location = var.location + resource_group_name = var.resource_group_name + + sku = var.sku + capacity = local.namespace_capacity + + tags = var.tags + + depends_on = [ + azapi_resource.resource_group + ] +} + +resource "azurerm_eventhub" "eh" { + name = var.eventhub_name + namespace_name = azurerm_eventhub_namespace.ns.name + resource_group_name = var.resource_group_name + + partition_count = var.partition_count + message_retention = var.message_retention + + depends_on = [ + azurerm_eventhub_namespace.ns + ] +} + +resource "azurerm_eventhub_consumer_group" "cg" { + for_each = toset(var.consumer_group_names) + + name = each.value + namespace_name = azurerm_eventhub_namespace.ns.name + eventhub_name = azurerm_eventhub.eh.name + resource_group_name = var.resource_group_name +} diff --git a/5_analytics-bigdata/event-hub/output.tf b/5_analytics-bigdata/event-hub/output.tf new file mode 100644 index 0000000..45137c7 --- /dev/null +++ b/5_analytics-bigdata/event-hub/output.tf @@ -0,0 +1,29 @@ +output "resource_group_id" { + description = "The resource ID of the Resource Group." + value = azapi_resource.resource_group.id +} + +output "eventhub_namespace_id" { + description = "The resource ID of the Event Hubs namespace." + value = azurerm_eventhub_namespace.ns.id +} + +output "eventhub_namespace_name" { + description = "The name of the Event Hubs namespace." + value = azurerm_eventhub_namespace.ns.name +} + +output "eventhub_id" { + description = "The resource ID of the Event Hub." + value = azurerm_eventhub.eh.id +} + +output "eventhub_name" { + description = "The name of the Event Hub." + value = azurerm_eventhub.eh.name +} + +output "consumer_group_ids" { + description = "Map of consumer group names to IDs." + value = { for k, v in azurerm_eventhub_consumer_group.cg : k => v.id } +} diff --git a/5_analytics-bigdata/event-hub/provider.tf b/5_analytics-bigdata/event-hub/provider.tf new file mode 100644 index 0000000..7d7d83a --- /dev/null +++ b/5_analytics-bigdata/event-hub/provider.tf @@ -0,0 +1,39 @@ +# provider.tf +# This file configures the Azure provider to interact with Azure resources. +# It specifies the required provider and its version, along with provider-specific configurations. + +terraform { + required_version = ">= 1.8, < 2.0" + + required_providers { + azurerm = { + source = "hashicorp/azurerm" + version = "~> 3.116" + } + + azapi = { + source = "Azure/azapi" + version = "~> 1.13" + } + + random = { + source = "hashicorp/random" + version = "~> 3.6" + } + } +} + +provider "azurerm" { + features { + resource_group { + prevent_deletion_if_contains_resources = false + } + } + + # Uses the current Azure CLI context (az login + az account set) + skip_provider_registration = false +} + +provider "azapi" { + # Uses the current Azure CLI context (az login + az account set) +} diff --git a/5_analytics-bigdata/event-hub/terraform.tfvars b/5_analytics-bigdata/event-hub/terraform.tfvars new file mode 100644 index 0000000..714c487 --- /dev/null +++ b/5_analytics-bigdata/event-hub/terraform.tfvars @@ -0,0 +1,26 @@ +# Adjust this as needed +# tfvars -> values used for deployment process +resource_group_name = "rg-analytics-dev-EH" +location = "eastus" + +append_random_suffix = true +random_suffix_length = 6 + +eventhub_namespace_name = "ehns-analytics-dev" +eventhub_name = "events" + +sku = "Standard" +capacity = 1 + +partition_count = 2 +message_retention = 1 + +consumer_group_names = [ + "cg-default" +] + +tags = { + env = "dev" + area = "analytics-bigdata" + iac = "terraform" +} diff --git a/5_analytics-bigdata/event-hub/variables.tf b/5_analytics-bigdata/event-hub/variables.tf new file mode 100644 index 0000000..b34eb24 --- /dev/null +++ b/5_analytics-bigdata/event-hub/variables.tf @@ -0,0 +1,122 @@ +# variables.tf + +variable "resource_group_name" { + description = "The name of the Azure Resource Group to deploy into. This template will create the RG if it does not exist (idempotent ARM PUT)." + type = string + + validation { + condition = length(trimspace(var.resource_group_name)) > 0 + error_message = "resource_group_name must not be empty." + } +} + +variable "location" { + description = "The Azure region where the Resource Group and Event Hubs resources will be created." + type = string + + validation { + condition = length(trimspace(var.location)) > 0 + error_message = "location must not be empty." + } +} + +variable "append_random_suffix" { + description = "Whether to append a random suffix to globally-unique names (for example, the Event Hubs namespace) to avoid collisions." + type = bool + default = true +} + +variable "random_suffix_length" { + description = "Length of the random suffix appended when append_random_suffix is true." + type = number + default = 6 + + validation { + condition = var.random_suffix_length >= 4 && var.random_suffix_length <= 16 + error_message = "random_suffix_length must be between 4 and 16." + } +} + +variable "tags" { + description = "A map of tags to assign to the resources." + type = map(string) + default = {} +} + +variable "eventhub_namespace_name" { + description = "Base name of the Event Hubs namespace. If append_random_suffix is true, the final name will be '-'." + type = string + + validation { + condition = ( + length(trimspace(var.eventhub_namespace_name)) >= 6 + && length(var.eventhub_namespace_name) <= (var.append_random_suffix ? (50 - 1 - var.random_suffix_length) : 50) + && can(regex("^[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$", var.eventhub_namespace_name)) + ) + error_message = "eventhub_namespace_name must be 6-50 chars, contain only alphanumeric or '-', start/end with alphanumeric, and leave room for '-' when append_random_suffix is true." + } +} + +variable "eventhub_name" { + description = "Name of the Event Hub to create within the namespace." + type = string + + validation { + condition = ( + length(trimspace(var.eventhub_name)) > 0 + && length(var.eventhub_name) <= 256 + && can(regex("^[a-zA-Z0-9][a-zA-Z0-9._-]*$", var.eventhub_name)) + ) + error_message = "eventhub_name must be 1-256 chars and contain only alphanumeric, '.', '_', or '-'." + } +} + +variable "sku" { + description = "Event Hubs namespace SKU. Allowed: Basic, Standard, Premium." + type = string + default = "Standard" + + validation { + condition = contains(["Basic", "Standard", "Premium"], var.sku) + error_message = "sku must be one of: Basic, Standard, Premium." + } +} + +variable "capacity" { + description = "Namespace capacity. For Basic, this is ignored. For Standard, it represents throughput units; for Premium, it represents messaging units." + type = number + default = 1 + + validation { + condition = var.capacity >= 1 + error_message = "capacity must be >= 1." + } +} + +variable "partition_count" { + description = "Number of partitions for the Event Hub." + type = number + default = 2 + + validation { + condition = var.partition_count >= 1 && var.partition_count <= 32 + error_message = "partition_count must be between 1 and 32." + } +} + +variable "message_retention" { + description = "Message retention in days for the Event Hub." + type = number + default = 1 + + validation { + condition = var.message_retention >= 1 && var.message_retention <= 90 + error_message = "message_retention must be between 1 and 90." + } +} + +variable "consumer_group_names" { + description = "Optional list of consumer group names to create for the Event Hub." + type = list(string) + default = [] +} diff --git a/5_analytics-bigdata/synapse-analytics/README.md b/5_analytics-bigdata/synapse-analytics/README.md index a318b17..520a117 100644 --- a/5_analytics-bigdata/synapse-analytics/README.md +++ b/5_analytics-bigdata/synapse-analytics/README.md @@ -100,7 +100,7 @@ Last updated: 2026-02-12
- Total views -

Refresh Date: 2026-02-12

+ Total views +

Refresh Date: 2026-02-16

diff --git a/6_monitoring-management/README.md b/6_monitoring-management/README.md index f19709c..52f717d 100644 --- a/6_monitoring-management/README.md +++ b/6_monitoring-management/README.md @@ -14,7 +14,7 @@ Last updated: 2026-02-09
- Total views -

Refresh Date: 2026-02-12

+ Total views +

Refresh Date: 2026-02-16

diff --git a/7_iot/README.md b/7_iot/README.md index cfef4dc..be58e2a 100644 --- a/7_iot/README.md +++ b/7_iot/README.md @@ -14,7 +14,7 @@ Last updated: 2026-02-09
- Total views -

Refresh Date: 2026-02-12

+ Total views +

Refresh Date: 2026-02-16

diff --git a/8_ai-ml/README.md b/8_ai-ml/README.md index a069616..56ef391 100644 --- a/8_ai-ml/README.md +++ b/8_ai-ml/README.md @@ -14,7 +14,7 @@ Last updated: 2026-02-09
- Total views -

Refresh Date: 2026-02-12

+ Total views +

Refresh Date: 2026-02-16

diff --git a/9_developer-tools/README.md b/9_developer-tools/README.md index 44f284a..41b1b4b 100644 --- a/9_developer-tools/README.md +++ b/9_developer-tools/README.md @@ -14,7 +14,7 @@ Last updated: 2026-02-09
- Total views -

Refresh Date: 2026-02-12

+ Total views +

Refresh Date: 2026-02-16

diff --git a/README.md b/README.md index 17db11c..2f852e9 100644 --- a/README.md +++ b/README.md @@ -257,8 +257,8 @@ graph TD;
- Total views -

Refresh Date: 2026-02-12

+ Total views +

Refresh Date: 2026-02-16