-
Notifications
You must be signed in to change notification settings - Fork 2
/
service-bus.tf
32 lines (29 loc) · 1.23 KB
/
service-bus.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
locals {
events_topic_name = "${var.product}-case-events-${var.env}"
servicebus_namespace_name = "${var.product}-servicebus-${var.env}"
resource_group_name = azurerm_resource_group.rg.name
}
module "servicebus-namespace" {
providers = {
azurerm.private_endpoint = azurerm.aks-infra
}
source = "[email protected]:hmcts/terraform-module-servicebus-namespace?ref=master"
name = local.servicebus_namespace_name
location = var.location
resource_group_name = azurerm_resource_group.rg.name
env = var.env
common_tags = local.tags
sku = var.sku
zone_redundant = var.sku != "Premium" ? "false" : "true"
}
module "events-topic" {
source = "[email protected]:hmcts/terraform-module-servicebus-topic?ref=master"
name = local.events_topic_name
namespace_name = module.servicebus-namespace.name
resource_group_name = local.resource_group_name
}
resource "azurerm_key_vault_secret" "servicebus_primary_connection_string" {
name = "ccd-servicebus-connection-string"
value = module.servicebus-namespace.primary_send_and_listen_connection_string
key_vault_id = module.vault.key_vault_id
}