Skip to content

Commit

Permalink
Create CCPAY cpo topic and subscription - Demo (#66)
Browse files Browse the repository at this point in the history
* https://tools.hmcts.net/jira/browse/PAY-5177

* https://tools.hmcts.net/jira/browse/PAY-5177

Co-authored-by: maharajan-jegan <maharajan.jegan@hmcts.net>
  • Loading branch information
vijayrajagopalan-hmcts and maharajan-jegan authored Sep 13, 2021
1 parent 6b26c78 commit 16bd12c
Showing 1 changed file with 31 additions and 10 deletions.
41 changes: 31 additions & 10 deletions servicebus.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ module "topic" {
resource_group_name = azurerm_resource_group.rg.name
}

module "topic_cpo" {
source = "git@github.com:hmcts/terraform-module-servicebus-topic"
name = "ccpay-cpo-Topic"
namespace_name = module.servicebus-namespace.name
resource_group_name = azurerm_resource_group.rg.name
}

module "queue" {
source = "git@github.com:hmcts/terraform-module-servicebus-queue"
name = local.retry_queue
Expand All @@ -36,23 +43,37 @@ module "subscription" {
forward_dead_lettered_messages_to = module.queue.name
}


module "subscription_cpo" {
source = "git@github.com:hmcts/terraform-module-servicebus-subscription"
name = local.subscription_name
namespace_name = module.servicebus-namespace.name
topic_name = module.topic_cpo.name
resource_group_name = azurerm_resource_group.rg.name
max_delivery_count = "1"
# forward_dead_lettered_messages_to = module.queue.name
}

resource "azurerm_key_vault_secret" "servicebus_primary_connection_string" {
name = "sb-primary-connection-string"
value = module.servicebus-namespace.primary_send_and_listen_connection_string
key_vault_id = data.azurerm_key_vault.ccpay_key_vault.id
}

# primary connection string for send and listen operations
output "sb_primary_send_and_listen_connection_string" {
value = module.servicebus-namespace.primary_send_and_listen_connection_string
resource "azurerm_key_vault_secret" "cpo-topic-primary-send-listen-shared-access-key" {
name = "cpo-topic-primary-send-listen-shared-access-key"
value = module.topic_cpo.primary_send_and_listen_shared_access_key
key_vault_id = data.azurerm_key_vault.ccpay_key_vault.id
}

output "topic_primary_send_and_listen_connection_string" {
value = module.topic.primary_send_and_listen_connection_string
}
# primary connection string for send and listen operations
# output "sb_primary_send_and_listen_connection_string" {
# value = module.servicebus-namespace.primary_send_and_listen_connection_string
# }

output "psc_subscription_connection_string" {
value = "${module.topic.primary_send_and_listen_connection_string}/subscriptions/${local.subscription_name}"
}
# output "topic_primary_send_and_listen_connection_string" {
# value = module.topic.primary_send_and_listen_connection_string
# }

# output "psc_subscription_connection_string" {
# value = "${module.topic.primary_send_and_listen_connection_string}/subscriptions/${local.subscription_name}"
# }

0 comments on commit 16bd12c

Please sign in to comment.