Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create CCPAY cpo topic and subscription - Demo #66

Merged
merged 2 commits into from
Sep 13, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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}"
# }