azurerm_eventgrid_event_subscription

Manages an EventGrid Event Subscription

Example Usage

resource "azurerm_resource_group" "example" {
  name     = "example-resources"
  location = "West Europe"
}

resource "azurerm_storage_account" "example" {
  name                     = "exampleasa"
  resource_group_name      = azurerm_resource_group.example.name
  location                 = azurerm_resource_group.example.location
  account_tier             = "Standard"
  account_replication_type = "LRS"

  tags = {
    environment = "staging"
  }
}

resource "azurerm_storage_queue" "example" {
  name                 = "example-astq"
  storage_account_name = azurerm_storage_account.example.name
}

resource "azurerm_eventgrid_event_subscription" "example" {
  name  = "example-aees"
  scope = azurerm_resource_group.example.id

  storage_queue_endpoint {
    storage_account_id = azurerm_storage_account.example.id
    queue_name         = azurerm_storage_queue.example.name
  }
}

Argument Reference

The following arguments are supported:


A storage_queue_endpoint block supports the following:


An azure_function_endpoint block supports the following:


A webhook_endpoint block supports the following:


A subject_filter block supports the following:


A advanced_filter supports the following nested blocks:

Each nested block consists of a key and a value(s) element.

OR


A delivery_identity block supports the following:


A delivery_property block supports the following:


A dead_letter_identity block supports the following:


A storage_blob_dead_letter_destination block supports the following:


A retry_policy block supports the following:

Attributes Reference

In addition to the Arguments listed above - the following Attributes are exported:

Timeouts

The timeouts block allows you to specify timeouts for certain actions:

Import

EventGrid Event Subscription's can be imported using the resource id, e.g.

terraform import azurerm_eventgrid_event_subscription.eventSubscription1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.EventGrid/topics/topic1/providers/Microsoft.EventGrid/eventSubscriptions/eventSubscription1