Skip to content

Commit

Permalink
move A&I export to domain EH + upgrade plan + add new profile-deletio…
Browse files Browse the repository at this point in the history
…n topic
  • Loading branch information
gquadrati committed Oct 18, 2024
1 parent ca06c39 commit 086f9df
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 6 deletions.
31 changes: 31 additions & 0 deletions src/domains/elt/_modules/function_apps/data.tf
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,37 @@ data "azurerm_eventhub_authorization_rule" "evh_ns_io_cosmos_profiles_fn" {
resource_group_name = "${var.project}-evt-rg"
}

// ---------------------
// A&I Event Hub Topic
// ---------------------

data "azurerm_eventhub_authorization_rule" "evh_ns_service_preferences_send_auth_rule" {
name = "io-fn-elt"
namespace_name = "${var.project}-itn-auth-elt-evhns-01"
eventhub_name = "pdnd-io-cosmosdb-service-preferences"
resource_group_name = "${var.project}-itn-auth-elt-rg-01"
}

data "azurerm_eventhub_authorization_rule" "evh_ns_profiles_send_auth_rule" {
name = "io-fn-elt"
namespace_name = "${var.project}-itn-auth-elt-evhns-01"
eventhub_name = "pdnd-io-cosmosdb-profiles"
resource_group_name = "${var.project}-itn-auth-elt-rg-01"
}


data "azurerm_eventhub_authorization_rule" "evh_ns_profile_deletion_send_auth_rule" {
name = "io-fn-elt"
namespace_name = "${var.project}-itn-auth-elt-evhns-01"
eventhub_name = "pdnd-io-cosmosdb-profile-deletion"
resource_group_name = "${var.project}-itn-auth-elt-rg-01"
}

// ---------------------
// /end A&I Event Hub Topic
// ---------------------


data "azurerm_key_vault" "kv_common" {
name = "${var.project}-kv-common"
resource_group_name = local.resource_group_name_common
Expand Down
31 changes: 26 additions & 5 deletions src/domains/elt/_modules/function_apps/function_app_elt.tf
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,30 @@ locals {
NOTIFICATION_STATUS_TOPIC_CONNECTION_STRING = data.azurerm_eventhub_authorization_rule.evh_ns_pdnd_io_cosmos_notification_status_fn.primary_connection_string
NOTIFICATION_STATUS_LEASES_PREFIX = "notification-status-001"

// A&I Event Hub
TARGETKAFKAAUTH_clientId = "IO_FUNCTIONS_ELT"
TARGETKAFKAAUTH_brokers = local.auth_event_hub_connection
TARGETKAFKAAUTH_ssl = "true"
TARGETKAFKAAUTH_maxInFlightRequests = "1"
TARGETKAFKAAUTH_idempotent = "true"
TARGETKAFKAAUTH_transactionalId = "IO_ELT"
TARGETKAFKAAUTH_sasl_mechanism = "plain"
TARGETKAFKAAUTH_sasl_username = "$ConnectionString"
TARGETKAFKAAUTH_sasl_password = data.azurerm_eventhub_authorization_rule.evh_ns_service_preferences_send_auth_rule.primary_connection_string
TARGETKAFKAAUTH_topic = "pdnd-io-cosmosdb-service-preferences"

SERVICE_PREFERENCES_TOPIC_NAME = "pdnd-io-cosmosdb-service-preferences"
SERVICE_PREFERENCES_TOPIC_CONNECTION_STRING = data.azurerm_eventhub_authorization_rule.evh_ns_pdnd_io_cosmos_service_preferences_fn.primary_connection_string
SERVICE_PREFERENCES_LEASES_PREFIX = "service-preferences-001"
SERVICE_PREFERENCES_TOPIC_CONNECTION_STRING = data.azurerm_eventhub_authorization_rule.evh_ns_service_preferences_send_auth_rule.primary_connection_string
SERVICE_PREFERENCES_LEASES_PREFIX = "service-preferences-003"

PROFILES_TOPIC_NAME = "pdnd-io-cosmosdb-profiles"
PROFILES_TOPIC_CONNECTION_STRING = data.azurerm_eventhub_authorization_rule.evh_ns_pdnd_io_cosmos_profiles_fn.primary_connection_string
PROFILES_LEASES_PREFIX = "profiles-001"
PROFILES_TOPIC_CONNECTION_STRING = data.azurerm_eventhub_authorization_rule.evh_ns_profiles_send_auth_rule.primary_connection_string
PROFILES_LEASES_PREFIX = "profiles-003"

PROFILE_DELETION_TOPIC_NAME = "pdnd-io-cosmosdb-profile-deletion"
PROFILE_DELETION_TOPIC_CONNECTION_STRING = data.azurerm_eventhub_authorization_rule.evh_ns_profile_deletion_send_auth_rule.primary_connection_string
PROFILE_DELETION_LEASES_PREFIX = "profile-deletion-001"


ERROR_STORAGE_ACCOUNT = var.storage_account_name
ERROR_STORAGE_KEY = var.storage_account_primary_access_key
Expand Down Expand Up @@ -97,6 +114,7 @@ locals {
SERVICES_FAILURE_QUEUE_NAME = "pdnd-io-cosmosdb-services-failure"
SERVICE_PREFERENCES_FAILURE_QUEUE_NAME = local.service_preferences_failure_queue_name
PROFILES_FAILURE_QUEUE_NAME = local.profiles_failure_queue_name
PROFILE_DELETION_FAILURE_QUEUE_NAME = local.profile_deletion_failure_queue_name

# PDV integration env variables
PDV_TOKENIZER_API_KEY = data.azurerm_key_vault_secret.pdv_tokenizer_api_key.value,
Expand Down Expand Up @@ -153,6 +171,7 @@ module "function_elt" {
"AzureWebJobs.AnalyticsServiceStorageQueueInboundProcessorAdapter.Disabled" = "0"
"AzureWebJobs.AnalyticsServicePreferencesChangeFeedInboundProcessorAdapter.Disabled" = "1"
"AzureWebJobs.AnalyticsProfilesChangeFeedInboundProcessorAdapter.Disabled" = "1"
"AzureWebJobs.AnalyticsDeletesChangeFeedInboundProcessorAdapter.Disabled" = "1"
}
)

Expand Down Expand Up @@ -181,7 +200,9 @@ module "function_elt" {
local.service_preferences_failure_queue_name,
"${local.service_preferences_failure_queue_name}-poison",
local.profiles_failure_queue_name,
"${local.profiles_failure_queue_name}-poison"
"${local.profiles_failure_queue_name}-poison",
local.profile_deletion_failure_queue_name,
"${local.profile_deletion_failure_queue_name}-poison"
],
"containers" = [],
"blobs_retention_days" = 1,
Expand Down
4 changes: 3 additions & 1 deletion src/domains/elt/_modules/function_apps/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ locals {
"51.144.56.176/28",
]

event_hub_connection = "${format("%s-evh-ns", var.project)}.servicebus.windows.net:9093"
event_hub_connection = "${format("%s-evh-ns", var.project)}.servicebus.windows.net:9093"
auth_event_hub_connection = "${format("%s-itn-auth-elt-evhns-01", var.project)}.servicebus.windows.net:9093"

pn_service_id = "01G40DWQGKY5GRWSNM4303VNRP"

service_preferences_failure_queue_name = "pdnd-io-cosmosdb-service-preferences-failure"
profiles_failure_queue_name = "pdnd-io-cosmosdb-profiles-failure"
profile_deletion_failure_queue_name = "pdnd-io-cosmosdb-profile-deletion-failure"
}

0 comments on commit 086f9df

Please sign in to comment.