Skip to content

azurermServicebusNamespaceAuthorizationRule

Manages a ServiceBus Namespace authorization Rule within a ServiceBus.

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: "terraform-servicebus",
  }
);
const azurermServicebusNamespaceExample =
  new azurerm.servicebusNamespace.ServicebusNamespace(this, "example_1", {
    location: azurermResourceGroupExample.location,
    name: "tfex-servicebus-namespace",
    resource_group_name: azurermResourceGroupExample.name,
    sku: "Standard",
    tags: {
      source: "terraform",
    },
  });
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermServicebusNamespaceExample.overrideLogicalId("example");
const azurermServicebusNamespaceAuthorizationRuleExample =
  new azurerm.servicebusNamespaceAuthorizationRule.ServicebusNamespaceAuthorizationRule(
    this,
    "example_2",
    {
      listen: true,
      manage: false,
      name: "examplerule",
      namespace_id: azurermServicebusNamespaceExample.id,
      send: true,
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermServicebusNamespaceAuthorizationRuleExample.overrideLogicalId("example");

Argument Reference

The following arguments are supported:

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

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

\~> NOTE At least one of the 3 permissions below needs to be set.

  • listen - (Optional) Grants listen access to this this Authorization Rule. Defaults to false.

  • send - (Optional) Grants send access to this this Authorization Rule. Defaults to false.

  • manage - (Optional) Grants manage access to this this Authorization Rule. When this property is true - both listen and send must be too. Defaults to false.

Attributes Reference

The following attributes are exported:

  • id - The ServiceBus Topic ID.

  • primaryKey - The Primary Key for the ServiceBus Namespace authorization Rule.

  • primaryConnectionString - The Primary Connection String for the ServiceBus Namespace authorization Rule.

  • secondaryKey - The Secondary Key for the ServiceBus Namespace authorization Rule.

  • secondaryConnectionString - The Secondary Connection String for the ServiceBus Namespace authorization Rule.

  • primaryConnectionStringAlias - The alias Primary Connection String for the ServiceBus Namespace, if the namespace is Geo DR paired.

  • secondaryConnectionStringAlias - The alias Secondary Connection String for the ServiceBus Namespace

Timeouts

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

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

Import

ServiceBus Namespace authorization rules can be imported using the resourceId, e.g.

terraform import azurerm_servicebus_namespace_authorization_rule.rule1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.ServiceBus/namespaces/namespace1/authorizationRules/rule1