Azure Messaging Domain

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

azurerm_eventgrid_domain (Terraform)

The Domain in Messaging can be configured in Terraform with the resource name azurerm_eventgrid_domain. The following sections describe 7 examples of how to use the resource and its parameters.

Example Usage from GitHub

main.tf#L1
resource "azurerm_eventgrid_domain" "evnt_dmn" {
  name                = var.name
  resource_group_name = var.resource_group_name
  location            = var.location

  tags = var.tags
main.tf#L2
resource "azurerm_eventgrid_domain" "demo" {
  name                = join("-", ["eg", var.namespace, var.environment])
  location            = var.location
  resource_group_name = var.resource_group_name

  tags = {
main.tf#L31
resource "azurerm_eventgrid_domain" "main" {
  name = var.name

  resource_group_name = data.azurerm_resource_group.main.name
  location            = data.azurerm_resource_group.main.location

main.tf#L7
resource "azurerm_eventgrid_domain" "this" {
  input_schema        = var.input_schema
  location            = var.location
  name                = var.name
  resource_group_name = var.resource_group_name
  tags                = var.tags
main.tf#L31
resource "azurerm_eventgrid_domain" "main" {
  name = var.name

  resource_group_name = data.azurerm_resource_group.main.name
  location            = data.azurerm_resource_group.main.location

main.tf#L7
resource "azurerm_eventgrid_domain" "this" {
  input_schema        = var.input_schema
  location            = var.location
  name                = var.name
  resource_group_name = var.resource_group_name
  tags                = var.tags
event-grid.tf#L22
resource "azurerm_eventgrid_domain" "j1dev" {
  count               = local.event_grid_domain_count
  name                = "j1dev-event-grid-domain"
  location            = azurerm_resource_group.j1dev.location
  resource_group_name = azurerm_resource_group.j1dev.name

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 an EventGrid Domain

Microsoft.EventGrid/domains (Azure Resource Manager)

The domains in Microsoft.EventGrid can be configured in Azure Resource Manager with the resource name Microsoft.EventGrid/domains. 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
  • identity optional
      • principalId optional - string

        The principal ID of resource identity.

      • tenantId optional - string

        The tenant ID of resource.

      • type optional - string

        The type of managed identity used. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user-assigned identities. The type 'None' will remove any identity.

      • userAssignedIdentities optional - undefined

        The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. This property is currently not used and reserved for future usage.

  • location required - string

    Location of the resource.

  • name required - string

    Name of the domain.

  • properties required
      • autoCreateTopicWithFirstSubscription optional - boolean

        This Boolean is used to specify the creation mechanism for 'all' the Event Grid Domain Topics associated with this Event Grid Domain resource. In this context, creation of domain topic can be auto-managed (when true) or self-managed (when false). The default value for this property is true. When this property is null or set to true, Event Grid is responsible of automatically creating the domain topic when the first event subscription is created at the scope of the domain topic. If this property is set to false, then creating the first event subscription will require creating a domain topic by the user. The self-management mode can be used if the user wants full control of when the domain topic is created, while auto-managed mode provides the flexibility to perform less operations and manage fewer resources by the user. Also, note that in auto-managed creation mode, user is allowed to create the domain topic on demand if needed.

      • autoDeleteTopicWithLastSubscription optional - boolean

        This Boolean is used to specify the deletion mechanism for 'all' the Event Grid Domain Topics associated with this Event Grid Domain resource. In this context, deletion of domain topic can be auto-managed (when true) or self-managed (when false). The default value for this property is true. When this property is set to true, Event Grid is responsible of automatically deleting the domain topic when the last event subscription at the scope of the domain topic is deleted. If this property is set to false, then the user needs to manually delete the domain topic when it is no longer needed (e.g., when last event subscription is deleted and the resource needs to be cleaned up). The self-management mode can be used if the user wants full control of when the domain topic needs to be deleted, while auto-managed mode provides the flexibility to perform less operations and manage fewer resources by the user.

      • disableLocalAuth optional - boolean

        This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to the domain.

      • inboundIpRules optional array
          • action optional - string

            Action to perform based on the match or no match of the IpMask.

          • ipMask optional - string

            IP Address in CIDR notation e.g., 10.0.0.0/8.

      • inputSchema optional - string

        This determines the format that Event Grid should expect for incoming events published to the domain.

      • inputSchemaMapping optional
        • publicNetworkAccess optional - string

          This determines if traffic is allowed over public network. By default it is enabled. You can further restrict to specific IPs by configuring <seealso cref="P:Microsoft.Azure.Events.ResourceProvider.Common.Contracts.DomainProperties.InboundIpRules" />.

    • tags optional - string

      Tags of the resource.

    • type required - string

    Frequently asked questions

    What is Azure Messaging Domain?

    Azure Messaging Domain 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 Domain?

    For Terraform, the bryannice/terraform-azure-modules, dmaxim/terrademo and Azure/osdu-infrastructure source code examples are useful. See the Terraform Example section for further details.