Skip to content

Commit

Permalink
[#IOPID-1978] Add new env variables for service-preferences export (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
gquadrati authored Aug 2, 2024
1 parent 17731d0 commit 9b78b0e
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 13 deletions.
1 change: 1 addition & 0 deletions src/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@
| [azurerm_dns_cname_record.assets_cdn_io_pagopa_it](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/dns_cname_record) | resource |
| [azurerm_key_vault_access_policy.access_policy_io_infra_cd](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/key_vault_access_policy) | resource |
| [azurerm_key_vault_access_policy.access_policy_io_infra_ci](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/key_vault_access_policy) | resource |
| [azurerm_key_vault_access_policy.access_policy_kv_io_infra_cd](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/key_vault_access_policy) | resource |
| [azurerm_key_vault_access_policy.adgroup_admin](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/key_vault_access_policy) | resource |
| [azurerm_key_vault_access_policy.adgroup_admin_common](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/key_vault_access_policy) | resource |
| [azurerm_key_vault_access_policy.adgroup_developers](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/key_vault_access_policy) | resource |
Expand Down
7 changes: 7 additions & 0 deletions src/domains/elt/_modules/function_apps/data.tf
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,13 @@ data "azurerm_eventhub_authorization_rule" "evh_ns_pdnd_io_cosmos_fn" {
resource_group_name = "${var.project}-evt-rg"
}

data "azurerm_eventhub_authorization_rule" "evh_ns_pdnd_io_cosmos_service_preferences_fn" {
name = "io-fn-elt"
namespace_name = "${var.project}-evh-ns"
eventhub_name = "pdnd-io-cosmosdb-service-preferences"
resource_group_name = "${var.project}-evt-rg"
}

data "azurerm_eventhub_authorization_rule" "evh_ns_import_command_fn" {
name = "io-fn-elt"
namespace_name = "${var.project}-evh-ns"
Expand Down
34 changes: 21 additions & 13 deletions src/domains/elt/_modules/function_apps/function_app_elt.tf
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ 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"

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"

ERROR_STORAGE_ACCOUNT = var.storage_account_name
ERROR_STORAGE_KEY = var.storage_account_primary_access_key
ERROR_STORAGE_TABLE = var.storage_account_tables.fnelterrors
Expand Down Expand Up @@ -83,9 +87,10 @@ locals {
MessageContentStorageConnection = data.azurerm_storage_account.storage_api_replica.primary_connection_string
ServiceInfoBlobStorageConnection = data.azurerm_storage_account.storage_assets_cdn.primary_connection_string

MESSAGES_FAILURE_QUEUE_NAME = "pdnd-io-cosmosdb-messages-failure"
MESSAGE_STATUS_FAILURE_QUEUE_NAME = "pdnd-io-cosmosdb-message-status-failure"
SERVICES_FAILURE_QUEUE_NAME = "pdnd-io-cosmosdb-services-failure"
MESSAGES_FAILURE_QUEUE_NAME = "pdnd-io-cosmosdb-messages-failure"
MESSAGE_STATUS_FAILURE_QUEUE_NAME = "pdnd-io-cosmosdb-message-status-failure"
SERVICES_FAILURE_QUEUE_NAME = "pdnd-io-cosmosdb-services-failure"
SERVICE_PREFERENCES_FAILURE_QUEUE_NAME = "pdnd-io-cosmosdb-service-preferences-failure"

INTERNAL_TEST_FISCAL_CODES = module.tests.test_users.all
}
Expand Down Expand Up @@ -120,15 +125,16 @@ module "function_elt" {

app_settings = merge(
local.function_elt.app_settings, {
"AzureWebJobs.CosmosApiServicesChangeFeed.Disabled" = "1"
"AzureWebJobs.CosmosApiMessageStatusChangeFeed.Disabled" = "1"
"AzureWebJobs.CosmosApiMessagesChangeFeed.Disabled" = "1"
"AzureWebJobs.AnalyticsMessagesChangeFeedInboundProcessorAdapter.Disabled" = "0"
"AzureWebJobs.AnalyticsMessagesStorageQueueInboundProcessorAdapter.Disabled" = "0"
"AzureWebJobs.AnalyticsMessageStatusChangeFeedInboundProcessorAdapter.Disabled" = "0"
"AzureWebJobs.AnalyticsMessageStatusStorageQueueInbloundAdapter.Disabled" = "0"
"AzureWebJobs.AnalyticsServiceChangeFeedInboundProcessorAdapter.Disabled" = "0"
"AzureWebJobs.AnalyticsServiceStorageQueueInboundProcessorAdapter.Disabled" = "0"
"AzureWebJobs.CosmosApiServicesChangeFeed.Disabled" = "1"
"AzureWebJobs.CosmosApiMessageStatusChangeFeed.Disabled" = "1"
"AzureWebJobs.CosmosApiMessagesChangeFeed.Disabled" = "1"
"AzureWebJobs.AnalyticsMessagesChangeFeedInboundProcessorAdapter.Disabled" = "0"
"AzureWebJobs.AnalyticsMessagesStorageQueueInboundProcessorAdapter.Disabled" = "0"
"AzureWebJobs.AnalyticsMessageStatusChangeFeedInboundProcessorAdapter.Disabled" = "0"
"AzureWebJobs.AnalyticsMessageStatusStorageQueueInbloundAdapter.Disabled" = "0"
"AzureWebJobs.AnalyticsServiceChangeFeedInboundProcessorAdapter.Disabled" = "0"
"AzureWebJobs.AnalyticsServiceStorageQueueInboundProcessorAdapter.Disabled" = "0"
"AzureWebJobs.AnalyticsServicePreferencesChangeFeedInboundProcessorAdapter.Disabled" = "1"
}
)

Expand All @@ -153,7 +159,9 @@ module "function_elt" {
local.function_elt.app_settings.MESSAGE_STATUS_FAILURE_QUEUE_NAME,
"${local.function_elt.app_settings.MESSAGE_STATUS_FAILURE_QUEUE_NAME}-poison",
local.function_elt.app_settings.SERVICES_FAILURE_QUEUE_NAME,
"${local.function_elt.app_settings.SERVICES_FAILURE_QUEUE_NAME}-poison"
"${local.function_elt.app_settings.SERVICES_FAILURE_QUEUE_NAME}-poison",
local.function_elt.app_settings.SERVICE_PREFERENCES_FAILURE_QUEUE_NAME,
"${local.function_elt.app_settings.SERVICE_PREFERENCES_FAILURE_QUEUE_NAME}-poison"
],
"containers" = [],
"blobs_retention_days" = 1,
Expand Down

0 comments on commit 9b78b0e

Please sign in to comment.