Skip to content

Instantly share code, notes, and snippets.

@xximjasonxx
Created December 14, 2019 02:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xximjasonxx/65495a04c537cb1e250d7c205bf2c4fd to your computer and use it in GitHub Desktop.
Save xximjasonxx/65495a04c537cb1e250d7c205bf2c4fd to your computer and use it in GitHub Desktop.
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