Manages a Notification Hub within a Notification Hub Namespace.
resource "azurerm_resource_group" "example" {
name = "notificationhub-resources"
location = "West Europe"
}
resource "azurerm_notification_hub_namespace" "example" {
name = "myappnamespace"
resource_group_name = azurerm_resource_group.example.name
location = azurerm_resource_group.example.location
namespace_type = "NotificationHub"
sku_name = "Free"
}
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
}
The following arguments are supported:
name
- (Required) The name to use for this Notification Hub. Changing this forces a new resource to be created.
namespace_name
- (Required) The name of the Notification Hub Namespace in which to create this Notification Hub. Changing this forces a new resource to be created.
resource_group_name
- (Required) The name of the Resource Group in which the Notification Hub Namespace exists. Changing this forces a new resource to be created.
location
- (Required) The Azure Region in which this Notification Hub Namespace exists. Changing this forces a new resource to be created.
apns_credential
- (Optional) A apns_credential
block as defined below.
gcm_credential
- (Optional) A gcm_credential
block as defined below.tags
- (Optional) A mapping of tags to assign to the resource.A apns_credential
block contains:
application_mode
- (Required) The Application Mode which defines which server the APNS Messages should be sent to. Possible values are Production
and Sandbox
.
bundle_id
- (Required) The Bundle ID of the iOS/macOS application to send push notifications for, such as com.hashicorp.example
.
key_id
- (Required) The Apple Push Notifications Service (APNS) Key.
team_id
- (Required) The ID of the team the Token.
token
- (Required) The Push Token associated with the Apple Developer Account. This is the contents of the key
downloaded from the Apple Developer Portal between the -----BEGIN PRIVATE KEY-----
and -----END PRIVATE KEY-----
blocks.
A gcm_credential
block contains:
api_key
- (Required) The API Key associated with the Google Cloud Messaging service.In addition to the Arguments listed above - the following Attributes are exported:
id
- The ID of the Notification Hub.The timeouts
block allows you to specify timeouts for certain actions:
create
- (Defaults to 30 minutes) Used when creating the Notification Hub.update
- (Defaults to 30 minutes) Used when updating the Notification Hub.read
- (Defaults to 5 minutes) Used when retrieving the Notification Hub.delete
- (Defaults to 30 minutes) Used when deleting the Notification Hub.Notification Hubs can be imported using the resource id
, e.g.
terraform import azurerm_notification_hub.hub1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.NotificationHubs/namespaces/namespace1/notificationHubs/hub1