github.com/paybyphone/terraform@v0.9.5-0.20170613192930-9706042ddd51/examples/azure-servicebus-create-topic-and-subscription/main.tf (about)

     1  # provider "azurerm" {
     2  #   subscription_id = "REPLACE-WITH-YOUR-SUBSCRIPTION-ID"
     3  #   client_id       = "REPLACE-WITH-YOUR-CLIENT-ID"
     4  #   client_secret   = "REPLACE-WITH-YOUR-CLIENT-SECRET"
     5  #   tenant_id       = "REPLACE-WITH-YOUR-TENANT-ID"
     6  # }
     7  
     8  resource "azurerm_resource_group" "rg" {
     9    name     = "${var.resource_group}"
    10    location = "${var.location}"
    11  }
    12  
    13  resource "azurerm_servicebus_namespace" "test" {
    14    depends_on          = ["azurerm_resource_group.rg"]
    15    name                = "${var.unique}servicebus"
    16    location            = "${var.location}"
    17    resource_group_name = "${var.resource_group}"
    18    sku                 = "standard"
    19  }
    20  
    21  resource "azurerm_servicebus_topic" "test" {
    22    name                = "${var.unique}Topic"
    23    location            = "${var.location}"
    24    resource_group_name = "${var.resource_group}"
    25    namespace_name      = "${azurerm_servicebus_namespace.test.name}"
    26  
    27    enable_partitioning = true
    28  }
    29  
    30  resource "azurerm_servicebus_subscription" "test" {
    31    name                = "${var.unique}Subscription"
    32    location            = "${var.location}"
    33    resource_group_name = "${var.resource_group}"
    34    namespace_name      = "${azurerm_servicebus_namespace.test.name}"
    35    topic_name          = "${azurerm_servicebus_topic.test.name}"
    36    max_delivery_count  = 1
    37  }