Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
provider "azurerm" {
version = "=1.36.0"
}
terraform {
backend "azurerm" {
}
}
variable "env_name" {
type = "string"
}
variable "topic_id" {
type = "string"
}
variable "app_url" {
type = "string"
}
variable "masterKey" {
type = "string"
}
resource "azurerm_eventgrid_event_subscription" "default" {
name = "userCreated-${var.env_name}-subscription"
scope = "${var.topic_id}"
event_delivery_schema = "EventGridSchema"
included_event_types = [ "UserCreatedEvent" ]
webhook_endpoint {
url = "${var.app_url}/runtime/webhooks/EventGrid?functionName=UserCreatedFunction&code=${var.masterKey}"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment