Azure Messaging Eventhub
This page shows how to write Terraform and Azure Resource Manager for Messaging Eventhub and write them securely.
azurerm_eventhub (Terraform)
The Eventhub in Messaging can be configured in Terraform with the resource name azurerm_eventhub
. The following sections describe 10 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "azurerm_eventhub" "providertesttpk1" {
name = "providerTestTopic1"
namespace_name = azurerm_eventhub_namespace.mqkconnector.name
resource_group_name = azurerm_resource_group.mqktest.name
partition_count = 5
message_retention = 7
resource "azurerm_eventhub" "input" {
name = "input"
namespace_name = azurerm_eventhub_namespace.event_ns.name
resource_group_name = local.resource_group_name
partition_count = 32
message_retention = 3 # day(s)
resource "azurerm_eventhub" "example" {
name = var.event_hubs_name
namespace_name = azurerm_eventhub_namespace.example.name
resource_group_name = azurerm_resource_group.policy-rg.name
partition_count = 2
message_retention = 1
resource "azurerm_eventhub" "example" {
name = var.name
namespace_name = var.namespace_name
resource_group_name = var.resource_group_name
partition_count = 2
message_retention = 1
resource "azurerm_eventhub" "eh" {
name = var.res_eh_name
namespace_name = var.res_eh_ns_name
resource_group_name = var.res_eh_rg_name
partition_count = var.res_eh_patition_count
message_retention = var.res_eh_msg_retention
resource "azurerm_eventhub" "evh" {
name = var.name-evh
resource_group_name = azurerm_resource_group.rg.name
namespace_name = azurerm_eventhub_namespace.evhns.name
partition_count = var.partition-count-evh
message_retention = var.message-retention-evh
resource "azurerm_eventhub" "evh" {
name = var.name-evh
resource_group_name = azurerm_resource_group.rg.name
namespace_name = azurerm_eventhub_namespace.evhns.name
partition_count = var.partition-count-evh
message_retention = var.message-retention-evh
resource "azurerm_eventhub" "hubs" {
name = "porterform-eventhub"
namespace_name = azurerm_eventhub_namespace.hubs.name
resource_group_name = azurerm_resource_group.rg.name
partition_count = 2
message_retention = 1
resource "azurerm_eventhub" "example" {
name = var.eventhub_name
namespace_name = azurerm_eventhub_namespace.example.name
resource_group_name = azurerm_resource_group.example.name
partition_count = 2
message_retention = 1
resource "azurerm_eventhub" "evhubiot" {
name = var.event_hub_name
resource_group_name = azurerm_resource_group.rg.name
namespace_name = azurerm_eventhub_namespace.evhubiotnmspace.name
partition_count = 2
message_retention = 1
Parameters
-
id
optional computed - string -
message_retention
required - number -
name
required - string -
namespace_name
required - string -
partition_count
required - number -
partition_ids
optional computed - set of string -
resource_group_name
required - string -
capture_description
list block-
enabled
required - bool -
encoding
required - string -
interval_in_seconds
optional - number -
size_limit_in_bytes
optional - number -
skip_empty_archives
optional - bool -
destination
list block-
archive_name_format
required - string -
blob_container_name
required - string -
name
required - string -
storage_account_id
required - string
-
-
-
timeouts
single block
Explanation in Terraform Registry
Manages a Event Hubs as a nested resource within a Event Hubs namespace.
Microsoft.EventHub/namespaces/eventhubs (Azure Resource Manager)
The namespaces/eventhubs in Microsoft.EventHub can be configured in Azure Resource Manager with the resource name Microsoft.EventHub/namespaces/eventhubs
. The following sections describe how to use the resource and its parameters.
Example Usage from GitHub
An example could not be found in GitHub.
Parameters
apiVersion
required - stringname
required - stringThe Event Hub name
properties
requiredcaptureDescription
optionaldestination
optionalname
optional - stringName for capture destination
properties
optionalarchiveNameFormat
optional - stringBlob naming convention for archive, e.g. {Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}. Here all the parameters (Namespace,EventHub .. etc) are mandatory irrespective of order
blobContainer
optional - stringBlob container Name
dataLakeAccountName
optional - stringThe Azure Data Lake Store name for the captured events
dataLakeFolderPath
optional - stringThe destination folder path for the captured events
dataLakeSubscriptionId
optional - stringSubscription Id of Azure Data Lake Store
storageAccountResourceId
optional - stringResource id of the storage account to be used to create the blobs
enabled
optional - booleanA value that indicates whether capture description is enabled.
encoding
optional - stringEnumerates the possible values for the encoding format of capture description. Note: 'AvroDeflate' will be deprecated in New API Version.
intervalInSeconds
optional - integerThe time window allows you to set the frequency with which the capture to Azure Blobs will happen, value should between 60 to 900 seconds
sizeLimitInBytes
optional - integerThe size window defines the amount of data built up in your Event Hub before an capture operation, value should be between 10485760 to 524288000 bytes
skipEmptyArchives
optional - booleanA value that indicates whether to Skip Empty Archives
messageRetentionInDays
optional - integerNumber of days to retain the events for this Event Hub, value should be 1 to 7 days
partitionCount
optional - integerNumber of partitions created for the Event Hub, allowed values are from 1 to 32 partitions.
status
optional - stringEnumerates the possible values for the status of the Event Hub.
type
required - string
Frequently asked questions
What is Azure Messaging Eventhub?
Azure Messaging Eventhub is a resource for Messaging of Microsoft Azure. Settings can be wrote in Terraform.
Where can I find the example code for the Azure Messaging Eventhub?
For Terraform, the rajuraghavan69/spring-boot-petclinic, marvin-heiden/sendungsverfolgung and timwebster9/azure-policy-logging source code examples are useful. See the Terraform Example section for further details.