» azurerm_servicebus_namespace

Manages a ServiceBus Namespace.

» Example Usage

provider "azurerm" {
  features {}

resource "azurerm_resource_group" "example" {
  name     = "terraform-servicebus"
  location = "West Europe"

resource "azurerm_servicebus_namespace" "example" {
  name                = "tfex-servicebus-namespace"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name
  sku                 = "Standard"

  tags = {
    source = "terraform"

» Argument Reference

The following arguments are supported:

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

  • resource_group_name - (Required) The name of the resource group in which to create the namespace.

  • 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. Options are basic, standard or premium. Changing this forces a new resource to be created.

  • capacity - (Optional) Specifies the capacity. When sku is Premium, capacity can be 1, 2, 4 or 8. When sku is Basic or Standard, capacity can be 0 only.

  • zone_redundant - (Optional) Whether or not this resource is zone redundant. sku needs to be Premium. Defaults to false.

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

» Attributes Reference

The following attributes are exported:

  • id - The ServiceBus Namespace ID.

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

» Timeouts

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

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

» Import

Service Bus Namespace can be imported using the resource id, e.g.

terraform import azurerm_servicebus_namespace.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/microsoft.servicebus/namespaces/sbns1