diff --git a/infra/templates/osdu-r3-mvp/data_partition/main.tf b/infra/templates/osdu-r3-mvp/data_partition/main.tf index b70be1804cf6c1e03681234d6d7ea06a9cce56cc..a5eef3795f96fad8d0cedcc9a8f7aa5ecc62bb47 100644 --- a/infra/templates/osdu-r3-mvp/data_partition/main.tf +++ b/infra/templates/osdu-r3-mvp/data_partition/main.tf @@ -96,6 +96,7 @@ locals { eg_sbtopic_subscriber = "servicebusrecordstopic" eg_sbtopic_schema_subscriber = "servicebusschemachangedtopic" + eg_sbtopic_legaltags_subscriber = "servicebuslegaltagschangedtopic" eventgrid_name = "${local.base_name_21}-grid" eventgrid_records_topic = format("%s-recordstopic", local.eventgrid_name) eventgrid_schema_notification_topic = format("%s-schemachangedtopic", local.eventgrid_name) @@ -350,6 +351,14 @@ resource "azurerm_eventgrid_event_subscription" "service_bus_topic_subscriber" { service_bus_topic_endpoint_id = lookup(module.service_bus.topicsmap, "recordstopiceg") } +// Add a Service Bus Topic subscriber that act as EventHandler for legaltagschangedtopic +resource "azurerm_eventgrid_event_subscription" "service_bus_topic_subscriber_legaltags" { + name = local.eg_sbtopic_legaltags_subscriber + scope = lookup(module.event_grid.topics, local.eventgrid_legaltags_topic) + depends_on = [module.service_bus.id] + service_bus_topic_endpoint_id = lookup(module.service_bus.topicsmap, "legaltagschangedtopiceg") +} + // Add EventGrid EventSubscription Contributor access to Principal For Schema resource "azurerm_role_assignment" "event_grid_topics_role_schema" { count = length(local.rbac_principals) diff --git a/infra/templates/osdu-r3-mvp/data_partition/terraform.tfvars b/infra/templates/osdu-r3-mvp/data_partition/terraform.tfvars index 904940440e58c54f14490dc7a852b87d43895971..c87cecc937fcccd2559b6948adfae6443171499a 100644 --- a/infra/templates/osdu-r3-mvp/data_partition/terraform.tfvars +++ b/infra/templates/osdu-r3-mvp/data_partition/terraform.tfvars @@ -314,5 +314,17 @@ sb_topics = [ forward_to = "" } ] + }, + { + name = "legaltagschangedtopiceg" + enable_partitioning = true + subscriptions = [ + { + name = "eg_sb_legaltagssubscription" + max_delivery_count = 5 + lock_duration = "PT5M" + forward_to = "" + } + ] } ] diff --git a/infra/templates/osdu-r3-mvp/data_partition/tests/unit/unit_test.go b/infra/templates/osdu-r3-mvp/data_partition/tests/unit/unit_test.go index 3f786fdb950b6b0894f1399a8a2e60ef780b6259..6447a676938790cf19ae9a654bcd3a43482b1c2a 100644 --- a/infra/templates/osdu-r3-mvp/data_partition/tests/unit/unit_test.go +++ b/infra/templates/osdu-r3-mvp/data_partition/tests/unit/unit_test.go @@ -49,7 +49,7 @@ func TestTemplate(t *testing.T) { TfOptions: tfOptions, Workspace: workspace, PlanAssertions: nil, - ExpectedResourceCount: 122, + ExpectedResourceCount: 125, ExpectedResourceAttributeValues: resourceDescription, }