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
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
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
resource "azurerm_notification_hub" "this" {
location = var.location
name = var.name
namespace_name = var.namespace_name
resource_group_name = var.resource_group_name
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
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
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
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
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
Parameters
-
id
optional computed - string -
location
required - string -
name
required - string -
namespace_name
required - string -
resource_group_name
required - string -
tags
optional - map from string to string -
apns_credential
list block-
application_mode
required - string -
bundle_id
required - string -
key_id
required - string -
team_id
required - string -
token
required - string
-
-
gcm_credential
list block-
api_key
required - string
-
-
timeouts
single block
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 - stringlocation
optional - stringResource location
name
required - stringThe notification hub name.
properties
requiredadmCredential
optionalproperties
optionalauthTokenUrl
optional - stringThe URL of the authorization token.
clientId
optional - stringThe client identifier.
clientSecret
optional - stringThe credential secret access key.
apnsCredential
optionalproperties
optionalapnsCertificate
optional - stringThe APNS certificate. Specify if using Certificate Authentication Mode.
appId
optional - stringThe 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 - stringThe name of the application or BundleId. Specify if using Token Authentication Mode.
certificateKey
optional - stringThe APNS certificate password if it exists.
endpoint
optional - stringThe 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 - stringA 10-character key identifier (kid) key, obtained from your developer account. Specify if using Token Authentication Mode.
thumbprint
optional - stringThe APNS certificate thumbprint. Specify if using Certificate Authentication Mode.
token
optional - stringProvider Authentication Token, obtained through your developer account. Specify if using Token Authentication Mode.
authorizationRules
optional arrayrights
optional - arrayThe rights associated with the rule.
baiduCredential
optionalproperties
optionalbaiduApiKey
optional - stringBaidu Api Key.
baiduEndPoint
optional - stringBaidu Endpoint.
baiduSecretKey
optional - stringBaidu Secret Key
gcmCredential
optionalproperties
optionalgcmEndpoint
optional - stringThe FCM legacy endpoint. Default value is 'https://fcm.googleapis.com/fcm/send'
googleApiKey
optional - stringThe Google API key.
mpnsCredential
optionalproperties
optionalcertificateKey
optional - stringThe certificate key for this credential.
mpnsCertificate
optional - stringThe MPNS certificate.
thumbprint
optional - stringThe MPNS certificate Thumbprint
name
optional - stringThe NotificationHub name.
registrationTtl
optional - stringThe RegistrationTtl of the created NotificationHub
wnsCredential
optionalproperties
optionalpackageSid
optional - stringThe package ID for this credential.
secretKey
optional - stringThe secret key.
windowsLiveEndpoint
optional - stringThe Windows Live endpoint.
sku
optionalcapacity
optional - integerThe capacity of the resource
family
optional - stringThe Sku Family
name
required - stringName of the notification hub sku.
size
optional - stringThe Sku size
tier
optional - stringThe tier of particular sku
tags
optional - stringResource 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.