Skip to content

Instantly share code, notes, and snippets.

@xximjasonxx
Created December 14, 2019 02:11
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/67c10a8d2002ffb0042bea92aa4eb450 to your computer and use it in GitHub Desktop.
Save xximjasonxx/67c10a8d2002ffb0042bea92aa4eb450 to your computer and use it in GitHub Desktop.
provider "azurerm" {
version = "=1.36.0"
}
terraform {
backend "azurerm" {
}
}
variable "app_name" {
type = "string"
}
variable "env_name" {
type = "string"
}
data "azurerm_resource_group" "rg" {
name = "${var.app_name}-rg"
}
resource "azurerm_eventgrid_topic" "topic" {
name = "${var.app_name}-${var.env_name}-topic"
location = "${data.azurerm_resource_group.rg.location}"
resource_group_name = "${data.azurerm_resource_group.rg.name}"
tags = {
environment = "${var.env_name}"
}
}
output "topic_access_key" {
value = "${azurerm_eventgrid_topic.topic.primary_access_key}"
}
output "topic_endpoint" {
value = "${azurerm_eventgrid_topic.topic.endpoint}"
}
output "topic_id" {
value = "${azurerm_eventgrid_topic.topic.id}"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment