forked from hmcts/hmc-shared-infrastructure
-
Notifications
You must be signed in to change notification settings - Fork 0
/
service-bus.tf
51 lines (44 loc) · 2.12 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
module "servicebus-namespace" {
source = "[email protected]:hmcts/terraform-module-servicebus-namespace?ref=master"
name = "${var.product}-servicebus-${var.env}"
resource_group_name = azurerm_resource_group.rg.name
location = var.location
env = var.env
common_tags = local.tags
sku = var.sku
zoneRedundant = (var.sku != "Premium" ? "false" : "true")
}
module "servicebus-queue-request" {
source = "[email protected]:hmcts/terraform-module-servicebus-queue?ref=master"
name = "${var.product}-to-hmi-${var.env}"
namespace_name = module.servicebus-namespace.name
resource_group_name = azurerm_resource_group.rg.name
}
module "servicebus-queue-response" {
source = "[email protected]:hmcts/terraform-module-servicebus-queue?ref=master"
name = "${var.product}-from-hmi-${var.env}"
namespace_name = module.servicebus-namespace.name
resource_group_name = azurerm_resource_group.rg.name
}
output "sb_primary_send_and_listen_connection_string" {
value = module.servicebus-namespace.primary_send_and_listen_connection_string
sensitive = true
}
resource "azurerm_key_vault_secret" "servicebus_primary_connection_string" {
name = "hmc-servicebus-connection-string"
value = module.servicebus-namespace.primary_send_and_listen_connection_string
key_vault_id = "${module.vault.key_vault_id}"
}
module "servicebus-topic" {
source = "[email protected]:hmcts/terraform-module-servicebus-topic?ref=master"
name = "${var.product}-to-cft-${var.env}"
namespace_name = module.servicebus-namespace.name
resource_group_name = azurerm_resource_group.rg.name
}
module "servicebus-subscription" {
source = "[email protected]:hmcts/terraform-module-servicebus-subscription?ref=master"
name = "${var.product}-subs-to-cft-${var.env}"
namespace_name = module.servicebus-namespace.name
topic_name = module.servicebus-topic.name
resource_group_name = azurerm_resource_group.rg.name
}