Commit 572ec322 authored by Hema Vishnu Pola [Microsoft]'s avatar Hema Vishnu Pola [Microsoft]
Browse files

Merge branch 'abhic-legaltags-eventgrid-topicname-changed' into 'master'

Changing LegalTags Topic name in EventGrid

See merge request !305
parents b91b66a6 e52231b9
Pipeline #41506 passed with stages
in 8 minutes and 16 seconds
......@@ -94,10 +94,10 @@ locals {
cosmosdb_name = "${local.base_name}-db"
sb_namespace = "${local.base_name_21}-bus"
eg_sbtopic_subscriber = "servicebusrecordstopic"
eventgrid_name = "${local.base_name_21}-grid"
eventgrid_records_topic = format("%s-recordstopic", local.eventgrid_name)
eventgrid_legaltagstate_topic = format("%s-legaltagstatechangetopic", local.eventgrid_name)
eg_sbtopic_subscriber = "servicebusrecordstopic"
eventgrid_name = "${local.base_name_21}-grid"
eventgrid_records_topic = format("%s-recordstopic", local.eventgrid_name)
eventgrid_legaltags_topic = format("%s-legaltagschangedtopic", local.eventgrid_name)
rbac_principals = [
data.terraform_remote_state.central_resources.outputs.osdu_identity_principal_id,
......@@ -310,7 +310,7 @@ module "event_grid" {
name = local.eventgrid_records_topic
},
{
name = local.eventgrid_legaltagstate_topic
name = local.eventgrid_legaltags_topic
}
]
......@@ -327,12 +327,12 @@ resource "azurerm_role_assignment" "event_grid_topics_role" {
}
// Add EventGrid EventSubscription Contributor access to Principal For Legal Tags
resource "azurerm_role_assignment" "event_grid_topics_role_legaltagstate" {
resource "azurerm_role_assignment" "event_grid_topics_role_legaltags" {
count = length(local.rbac_principals)
role_definition_name = "EventGrid EventSubscription Contributor"
principal_id = local.rbac_principals[count.index]
scope = lookup(module.event_grid.topics, local.eventgrid_legaltagstate_topic)
scope = lookup(module.event_grid.topics, local.eventgrid_legaltags_topic)
}
// Add a Service Bus Topic subscriber that is used by WKS service.
......
......@@ -43,16 +43,16 @@ locals {
sb_namespace_name = format("%s-sb-namespace", var.data_partition_name)
sb_connection = format("%s-sb-connection", var.data_partition_name)
eventgrid_domain_name = format("%s-eventgrid", var.data_partition_name)
eventgrid_domain_key_name = format("%s-key", local.eventgrid_domain_name)
eventgrid_recordschangedtopic_key_name = format("%s-eventgrid-recordstopic-accesskey", var.data_partition_name)
eventgrid_records_topic_name = format("%s-recordstopic", local.eventgrid_domain_name)
eventgrid_records_topic_endpoint = format("https://%s.%s-1.eventgrid.azure.net/api/events", local.eventgrid_records_topic, var.resource_group_location)
eventgrid_legaltagstatechangetopic_key_name = format("%s-eventgrid-legaltagstatechangetopic-accesskey", var.data_partition_name)
eventgrid_legaltagstate_topic_name = format("%s-legaltagstatechangetopic", local.eventgrid_domain_name)
eventgrid_legaltagstate_topic_endpoint = format("https://%s.%s-1.eventgrid.azure.net/api/events", local.eventgrid_legaltagstate_topic, var.resource_group_location)
encryption_key_identifier_name = format("%s-encryption-key-identifier", var.data_partition_name)
event_grid_resourcegroup_name = format("%s-eventgrid-resourcegroup", var.data_partition_name)
eventgrid_domain_name = format("%s-eventgrid", var.data_partition_name)
eventgrid_domain_key_name = format("%s-key", local.eventgrid_domain_name)
eventgrid_recordschangedtopic_key_name = format("%s-eventgrid-recordstopic-accesskey", var.data_partition_name)
eventgrid_records_topic_name = format("%s-recordstopic", local.eventgrid_domain_name)
eventgrid_records_topic_endpoint = format("https://%s.%s-1.eventgrid.azure.net/api/events", local.eventgrid_records_topic, var.resource_group_location)
eventgrid_legaltagschangedtopic_key_name = format("%s-eventgrid-legaltagschangedtopic-accesskey", var.data_partition_name)
eventgrid_legaltags_topic_name = format("%s-legaltagschangedtopic", local.eventgrid_domain_name)
eventgrid_legaltags_topic_endpoint = format("https://%s.%s-1.eventgrid.azure.net/api/events", local.eventgrid_legaltags_topic, var.resource_group_location)
encryption_key_identifier_name = format("%s-encryption-key-identifier", var.data_partition_name)
event_grid_resourcegroup_name = format("%s-eventgrid-resourcegroup", var.data_partition_name)
elastic_endpoint = format("%s-elastic-endpoint", var.data_partition_name)
elastic_username = format("%s-elastic-username", var.data_partition_name)
......@@ -173,9 +173,9 @@ resource "azurerm_key_vault_secret" "recordstopic_name" {
key_vault_id = data.terraform_remote_state.central_resources.outputs.keyvault_id
}
resource "azurerm_key_vault_secret" "legaltagstatechangetopic_name" {
name = local.eventgrid_legaltagstate_topic_name
value = local.eventgrid_legaltagstate_topic_endpoint
resource "azurerm_key_vault_secret" "legaltagschangedtopic_name" {
name = local.eventgrid_legaltags_topic_name
value = local.eventgrid_legaltags_topic_endpoint
key_vault_id = data.terraform_remote_state.central_resources.outputs.keyvault_id
}
......@@ -197,9 +197,9 @@ resource "azurerm_key_vault_secret" "eventgrid_topic_key" {
key_vault_id = data.terraform_remote_state.central_resources.outputs.keyvault_id
}
resource "azurerm_key_vault_secret" "eventgrid_legaltagstatechangetopic_key" {
name = local.eventgrid_legaltagstatechangetopic_key_name
value = lookup(module.event_grid.topic_accesskey_map, local.eventgrid_legaltagstate_topic)
resource "azurerm_key_vault_secret" "eventgrid_legaltagschangedtopic_key" {
name = local.eventgrid_legaltagschangedtopic_key_name
value = lookup(module.event_grid.topic_accesskey_map, local.eventgrid_legaltags_topic)
key_vault_id = data.terraform_remote_state.central_resources.outputs.keyvault_id
}
......
......@@ -104,13 +104,13 @@ data-partition-id: {{data_partition_id}}
"sensitive": true,
"value": "eventgrid-recordstopic-accesskey"
},
"eventgrid-legaltagstatechangetopic": {
"eventgrid-legaltagschangedtopic": {
"sensitive": true,
"value": "eventgrid-legaltagstatechangetopic"
"value": "eventgrid-legaltagschangedtopic"
},
"eventgrid-legaltagstatechangetopic-accesskey": {
"eventgrid-legaltagschangedtopic-accesskey": {
"sensitive": true,
"value": "eventgrid-legaltagstatechangetopic-accesskey"
"value": "eventgrid-legaltagschangedtopic-accesskey"
}
"eventgrid-resourcegroup": {
"sensitive": true,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment