0
votes

I have this Terraform resource:

resource "azurerm_notification_hub" "notificationhub" {
  name                                = "notification-hub-${var.environment}"
  namespace_name                      = azurerm_notification_hub_namespace.notificationhubnamespace.name
  resource_group_name                 = azurerm_resource_group.resourcegroup.name
  location                            = var.azure_location
}

This block works fine and it creates a hub on Azure.

But.. How can I get "DefaultFullSharedAccessSignature" from Terraform?

enter image description here

I don't find any documentation on Terraform https://www.terraform.io/docs/providers/azurerm/r/notification_hub.html

1

1 Answers

2
votes

I found a resource from terraform "azurerm_notification_hub_authorization_rule"

resource "azurerm_notification_hub_authorization_rule" "rule" {
  name                                = "Full"
  notification_hub_name               = azurerm_notification_hub.notificationhub.name
  namespace_name                      = azurerm_notification_hub_namespace.notificationhubnamespace.name
  resource_group_name                 = azurerm_resource_group.resourcegroup.name
  manage                              = true
  send                                = true
  listen                              = true

  depends_on                          = [azurerm_notification_hub.notificationhub]

}

And I can access to azurerm_notification_hub_authorization_rule.rule.primary.primary_access_key