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
-
idoptional computed - string -
message_retentionrequired - number -
namerequired - string -
namespace_namerequired - string -
partition_countrequired - number -
partition_idsoptional computed - set of string -
resource_group_namerequired - string -
capture_descriptionlist block-
enabledrequired - bool -
encodingrequired - string -
interval_in_secondsoptional - number -
size_limit_in_bytesoptional - number -
skip_empty_archivesoptional - bool -
destinationlist block-
archive_name_formatrequired - string -
blob_container_namerequired - string -
namerequired - string -
storage_account_idrequired - string
-
-
-
timeoutssingle 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
apiVersionrequired - stringnamerequired - stringThe Event Hub name
propertiesrequiredcaptureDescriptionoptionaldestinationoptionalnameoptional - stringName for capture destination
propertiesoptionalarchiveNameFormatoptional - 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
blobContaineroptional - stringBlob container Name
dataLakeAccountNameoptional - stringThe Azure Data Lake Store name for the captured events
dataLakeFolderPathoptional - stringThe destination folder path for the captured events
dataLakeSubscriptionIdoptional - stringSubscription Id of Azure Data Lake Store
storageAccountResourceIdoptional - stringResource id of the storage account to be used to create the blobs
enabledoptional - booleanA value that indicates whether capture description is enabled.
encodingoptional - stringEnumerates the possible values for the encoding format of capture description. Note: 'AvroDeflate' will be deprecated in New API Version.
intervalInSecondsoptional - 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
sizeLimitInBytesoptional - 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
skipEmptyArchivesoptional - booleanA value that indicates whether to Skip Empty Archives
messageRetentionInDaysoptional - integerNumber of days to retain the events for this Event Hub, value should be 1 to 7 days
partitionCountoptional - integerNumber of partitions created for the Event Hub, allowed values are from 1 to 32 partitions.
statusoptional - stringEnumerates the possible values for the status of the Event Hub.
typerequired - 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.