Skip to content

azurermEventhubNamespace

Manages an EventHub Namespace.

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as azurerm from "./.gen/providers/azurerm";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: azurerm.
For a more precise conversion please use the --provider flag in convert.*/
const azurermResourceGroupExample = new azurerm.resourceGroup.ResourceGroup(
  this,
  "example",
  {
    location: "West Europe",
    name: "example-resources",
  }
);
const azurermEventhubNamespaceExample =
  new azurerm.eventhubNamespace.EventhubNamespace(this, "example_1", {
    capacity: 2,
    location: azurermResourceGroupExample.location,
    name: "example-namespace",
    resource_group_name: azurermResourceGroupExample.name,
    sku: "Standard",
    tags: {
      environment: "Production",
    },
  });
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermEventhubNamespaceExample.overrideLogicalId("example");

Argument Reference

The following arguments are supported:

  • name - (Required) Specifies the name of the EventHub Namespace resource. Changing this forces a new resource to be created.

  • resourceGroupName - (Required) The name of the resource group in which to create the namespace. Changing this forces a new resource to be created.

  • location - (Required) Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.

  • sku - (Required) Defines which tier to use. Valid options are basic, standard, and premium. Please note that setting this field to premium will force the creation of a new resource.

  • capacity - (Optional) Specifies the Capacity / Throughput Units for a standard SKU namespace. Default capacity has a maximum of 2, but can be increased in blocks of 2 on a committed purchase basis. Defaults to 1.

  • autoInflateEnabled - (Optional) Is Auto Inflate enabled for the EventHub Namespace?

  • dedicatedClusterId - (Optional) Specifies the ID of the EventHub Dedicated Cluster where this Namespace should created. Changing this forces a new resource to be created.

  • identity - (Optional) An identity block as defined below.

  • maximumThroughputUnits - (Optional) Specifies the maximum number of throughput units when Auto Inflate is Enabled. Valid values range from 1 - 20.

  • zoneRedundant - (Optional) Specifies if the EventHub Namespace should be Zone Redundant (created across Availability Zones). Changing this forces a new resource to be created. Defaults to false.

\~> Note: For eventhub premium namespace, zoneRedundant is computed by api based on the availability zone feature in each region. User's input will be overridden. Please explicitly sets the property to true when creating the premium namespace in a region that supports availability zone since the default value is false in 3.0 provider.

  • tags - (Optional) A mapping of tags to assign to the resource.

  • networkRulesets - (Optional) A networkRulesets block as defined below.

  • localAuthenticationEnabled - (Optional) Is SAS authentication enabled for the EventHub Namespace? Defaults to true.

  • publicNetworkAccessEnabled - (Optional) Is public network access enabled for the EventHub Namespace? Defaults to true.

  • minimumTlsVersion - (Optional) The minimum supported TLS version for this EventHub Namespace. Valid values are: 10, 11 and 12. The current default minimum TLS version is 12.


A identity block supports the following:

  • type - (Required) Specifies the type of Managed Service Identity that should be configured on this Event Hub Namespace. Possible values are systemAssigned or userAssigned.

  • identityIds - (Optional) Specifies a list of User Assigned Managed Identity IDs to be assigned to this EventHub namespace.

\~> NOTE: This is required when type is set to userAssigned or systemAssigned,UserAssigned.

\~> Note: Due to the limitation of the current Azure API, once an EventHub Namespace has been assigned an identity, it cannot be removed.


A networkRulesets block supports the following:

  • defaultAction - (Required) The default action to take when a rule is not matched. Possible values are allow and deny.

  • publicNetworkAccessEnabled - (Optional) Is public network access enabled for the EventHub Namespace? Defaults to true.

\~> Note: The public network access setting at the network rule sets level should be the same as it's at the namespace level.

  • trustedServiceAccessEnabled - (Optional) Whether Trusted Microsoft Services are allowed to bypass firewall.

  • virtualNetworkRule - (Optional) One or more virtualNetworkRule blocks as defined below.

  • ipRule - (Optional) One or more ipRule blocks as defined below.


A virtualNetworkRule block supports the following:

  • subnetId - (Required) The id of the subnet to match on.

  • ignoreMissingVirtualNetworkServiceEndpoint - (Optional) Are missing virtual network service endpoints ignored?


A ipRule block supports the following:

  • ipMask - (Required) The IP mask to match on.

  • action - (Optional) The action to take when the rule is matched. Possible values are allow.

Attributes Reference

The following attributes are exported:

  • id - The EventHub Namespace ID.

  • identity - An identity block as documented below.

The following attributes are exported only if there is an authorization rule named rootManageSharedAccessKey which is created automatically by Azure.

  • defaultPrimaryConnectionString - The primary connection string for the authorization rule rootManageSharedAccessKey.

  • defaultPrimaryConnectionStringAlias - The alias of the primary connection string for the authorization rule rootManageSharedAccessKey, which is generated when disaster recovery is enabled.

  • defaultPrimaryKey - The primary access key for the authorization rule rootManageSharedAccessKey.

  • defaultSecondaryConnectionString - The secondary connection string for the authorization rule rootManageSharedAccessKey.

  • defaultSecondaryConnectionStringAlias - The alias of the secondary connection string for the authorization rule rootManageSharedAccessKey, which is generated when disaster recovery is enabled.

  • defaultSecondaryKey - The secondary access key for the authorization rule rootManageSharedAccessKey.


An identity block exports the following:

  • principalId - The Principal ID associated with this Managed Service Identity.

  • tenantId - The Tenant ID associated with this Managed Service Identity.

Timeouts

The timeouts block allows you to specify timeouts for certain actions:

  • create - (Defaults to 30 minutes) Used when creating the EventHub Namespace.
  • update - (Defaults to 30 minutes) Used when updating the EventHub Namespace.
  • read - (Defaults to 5 minutes) Used when retrieving the EventHub Namespace.
  • delete - (Defaults to 30 minutes) Used when deleting the EventHub Namespace.

Import

EventHub Namespaces can be imported using the resourceId, e.g.

terraform import azurerm_eventhub_namespace.namespace1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.EventHub/namespaces/namespace1