Azure Messaging Notification Hub

This page shows how to write Terraform and Azure Resource Manager for Messaging Notification Hub and write them securely.

azurerm_notification_hub (Terraform)

The Notification Hub in Messaging can be configured in Terraform with the resource name azurerm_notification_hub. The following sections describe 8 examples of how to use the resource and its parameters.

Example Usage from GitHub

notificationHubs.tf#L1
resource "azurerm_notification_hub" "example" {
  name                = "mynotificationhub"
  namespace_name      = azurerm_notification_hub_namespace.example.name
  resource_group_name = azurerm_resource_group.example.name
  location            = azurerm_resource_group.example.location
main.tf#L12
resource "azurerm_notification_hub" "notification_hub" {
  name                = var.azurerm_notification_hub_name
  namespace_name      = azurerm_notification_hub_namespace.notification_hub_ns.name
  resource_group_name = var.azurerm_resource_group
  location            = azurerm_notification_hub_namespace.notification_hub_ns.location

main.tf#L7
resource "azurerm_notification_hub" "this" {
  location            = var.location
  name                = var.name
  namespace_name      = var.namespace_name
  resource_group_name = var.resource_group_name

main.tf#L7
resource "azurerm_notification_hub" "this" {
  location            = var.location
  name                = var.name
  namespace_name      = var.namespace_name
  resource_group_name = var.resource_group_name
  tags                = var.tags
main.tf#L10
resource "azurerm_notification_hub" "main" {
  count               = length(var.notificationHubs)
  name                = element(var.notificationHubs, count.index).nh_name
  namespace_name      = azurerm_notification_hub_namespace.main.name
  resource_group_name = var.nh_resource_group_name
  location            = var.nh_location
main.tf#L44
resource "azurerm_notification_hub" "notification_hub" {
  name                = local.resource_name
  namespace_name      = azurerm_notification_hub_namespace.notification_hub_ns.name
  resource_group_name = var.resource_group_name
  location            = var.region

main.tf#L235
 resource "azurerm_notification_hub" "NHubs" {
  name                = "Hub-Terraform"
  namespace_name      = azurerm_notification_hub_namespace.namespace.name
  resource_group_name = azurerm_resource_group.RGroup.name
  location            = azurerm_resource_group.RGroup.location

main.tf#L243
 resource "azurerm_notification_hub" "NHubs" {
  name                = "Hub-Terraform"
  namespace_name      = azurerm_notification_hub_namespace.namespace.name
  resource_group_name = azurerm_resource_group.RGroup.name
  location            = azurerm_resource_group.RGroup.location

Review your Terraform file for Azure best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

Explanation in Terraform Registry

Manages a Notification Hub within a Notification Hub Namespace.

Microsoft.NotificationHubs/namespaces/notificationHubs (Azure Resource Manager)

The namespaces/notificationHubs in Microsoft.NotificationHubs can be configured in Azure Resource Manager with the resource name Microsoft.NotificationHubs/namespaces/notificationHubs. 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

  • apiVersion required - string
  • location optional - string

    Resource location

  • name required - string

    The notification hub name.

  • properties required
      • admCredential optional
          • properties optional
              • authTokenUrl optional - string

                The URL of the authorization token.

              • clientId optional - string

                The client identifier.

              • clientSecret optional - string

                The credential secret access key.

      • apnsCredential optional
          • properties optional
              • apnsCertificate optional - string

                The APNS certificate. Specify if using Certificate Authentication Mode.

              • appId optional - string

                The issuer (iss) registered claim key. The value is a 10-character TeamId, obtained from your developer account. Specify if using Token Authentication Mode.

              • appName optional - string

                The name of the application or BundleId. Specify if using Token Authentication Mode.

              • certificateKey optional - string

                The APNS certificate password if it exists.

              • endpoint optional - string

                The APNS endpoint of this credential. If using Certificate Authentication Mode and Sandbox specify 'gateway.sandbox.push.apple.com'. If using Certificate Authentication Mode and Production specify 'gateway.push.apple.com'. If using Token Authentication Mode and Sandbox specify 'https://api.development.push.apple.com:443/3/device'. If using Token Authentication Mode and Production specify 'https://api.push.apple.com:443/3/device'.

              • keyId optional - string

                A 10-character key identifier (kid) key, obtained from your developer account. Specify if using Token Authentication Mode.

              • thumbprint optional - string

                The APNS certificate thumbprint. Specify if using Certificate Authentication Mode.

              • token optional - string

                Provider Authentication Token, obtained through your developer account. Specify if using Token Authentication Mode.

      • authorizationRules optional array
          • rights optional - array

            The rights associated with the rule.

      • baiduCredential optional
          • properties optional
              • baiduApiKey optional - string

                Baidu Api Key.

              • baiduEndPoint optional - string

                Baidu Endpoint.

              • baiduSecretKey optional - string

                Baidu Secret Key

      • gcmCredential optional
      • mpnsCredential optional
          • properties optional
              • certificateKey optional - string

                The certificate key for this credential.

              • mpnsCertificate optional - string

                The MPNS certificate.

              • thumbprint optional - string

                The MPNS certificate Thumbprint

      • name optional - string

        The NotificationHub name.

      • registrationTtl optional - string

        The RegistrationTtl of the created NotificationHub

      • wnsCredential optional
          • properties optional
              • packageSid optional - string

                The package ID for this credential.

              • secretKey optional - string

                The secret key.

              • windowsLiveEndpoint optional - string

                The Windows Live endpoint.

  • sku optional
      • capacity optional - integer

        The capacity of the resource

      • family optional - string

        The Sku Family

      • name required - string

        Name of the notification hub sku.

      • size optional - string

        The Sku size

      • tier optional - string

        The tier of particular sku

  • tags optional - string

    Resource tags

  • type required - string

Frequently asked questions

What is Azure Messaging Notification Hub?

Azure Messaging Notification Hub 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 Notification Hub?

For Terraform, the dmaxim/wimc-net, sidhlipu/terraform and kevinhead/azurerm source code examples are useful. See the Terraform Example section for further details.