Created
December 14, 2019 02:11
-
-
Save xximjasonxx/67c10a8d2002ffb0042bea92aa4eb450 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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